@@ -817,12 +817,7 @@ int multifd_save_setup(Error **errp)
p->normal = g_new0(ram_addr_t, page_count);
p->page_size = qemu_target_page_size();
p->page_count = page_count;
-
- if (migrate_zero_copy_send()) {
- p->write_flags = QIO_CHANNEL_WRITE_FLAG_ZERO_COPY;
- } else {
- p->write_flags = 0;
- }
+ p->write_flags = 0;
multifd_new_send_channel_create(p);
}
@@ -206,6 +206,10 @@ void socket_start_incoming_migration(SocketAddress *saddr,
static int multifd_socket_send_setup(MultiFDSendParams *p, Error **errp)
{
+ if (migrate_zero_copy_send()) {
+ p->write_flags |= QIO_CHANNEL_WRITE_FLAG_ZERO_COPY;
+ }
+
return 0;
}
The generic multifd save setup code should not be responsible for deciding how the client code is going to send the data. Since the zero copy feature is supported only by the socket migration, move the setting of the flag into the socket specific function. Signed-off-by: Fabiano Rosas <farosas@suse.de> --- migration/multifd.c | 7 +------ migration/socket.c | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-)