From 48a4a44c1cde382c6b8e7792d01fe7d9b0a59c69 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Fri, 19 Nov 2021 15:03:02 +0100 Subject: multifd: Make zlib use iov's Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/multifd-zlib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'migration') diff --git a/migration/multifd-zlib.c b/migration/multifd-zlib.c index a2fec4d01d..71480c82bb 100644 --- a/migration/multifd-zlib.c +++ b/migration/multifd-zlib.c @@ -143,6 +143,9 @@ static int zlib_send_prepare(MultiFDSendParams *p, Error **errp) } out_size += available - zs->avail_out; } + p->iov[p->iovs_num].iov_base = z->zbuff; + p->iov[p->iovs_num].iov_len = out_size; + p->iovs_num++; p->next_packet_size = out_size; p->flags |= MULTIFD_FLAG_ZLIB; @@ -162,10 +165,7 @@ static int zlib_send_prepare(MultiFDSendParams *p, Error **errp) */ static int zlib_send_write(MultiFDSendParams *p, uint32_t used, Error **errp) { - struct zlib_data *z = p->data; - - return qio_channel_write_all(p->c, (void *)z->zbuff, p->next_packet_size, - errp); + return qio_channel_writev_all(p->c, p->iov, p->iovs_num, errp); } /** -- cgit v1.2.3