]> git.proxmox.com Git - mirror_qemu.git/commit
QIOChannelSocket: Fix zero-copy send so socket flush works
authorLeonardo Bras <leobras@redhat.com>
Mon, 20 Jun 2022 05:39:43 +0000 (02:39 -0300)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Wed, 22 Jun 2022 16:22:28 +0000 (17:22 +0100)
commit4f5a09714c983a3471fd12e3c7f3196e95c650c1
tree38d4379e621502af08525c00928d000b254cc717
parent803ca43e4c7fcf32f9f68c118301ccd0c83ece3f
QIOChannelSocket: Fix zero-copy send so socket flush works

Somewhere between v6 and v7 the of the zero-copy-send patchset a crucial
part of the flushing mechanism got missing: incrementing zero_copy_queued.

Without that, the flushing interface becomes a no-op, and there is no
guarantee the buffer is really sent.

This can go as bad as causing a corruption in RAM during migration.

Fixes: 2bc58ffc2926 ("QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX")
Reported-by: 徐闯 <xuchuangxclwt@bytedance.com>
Signed-off-by: Leonardo Bras <leobras@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
io/channel-socket.c