0727d3
From bac5ce0b4d3552d6056045f201b4e50dd6204b31 Mon Sep 17 00:00:00 2001
0727d3
From: Juan Quintela <quintela@redhat.com>
0727d3
Date: Wed, 18 May 2022 02:52:24 -0300
0727d3
Subject: [PATCH 13/37] multifd: Make zstd use iov's
0727d3
MIME-Version: 1.0
0727d3
Content-Type: text/plain; charset=UTF-8
0727d3
Content-Transfer-Encoding: 8bit
0727d3
0727d3
RH-Author: Leonardo Brás <leobras@redhat.com>
0727d3
RH-MergeRequest: 191: MSG_ZEROCOPY + Multifd @ rhel8.7
0727d3
RH-Commit: [13/26] 4d7036fb32efdf088d23737b9710e6ad1a4654aa
0727d3
RH-Bugzilla: 2072049
0727d3
RH-Acked-by: Peter Xu <peterx@redhat.com>
0727d3
RH-Acked-by: Daniel P. Berrangé <berrange@redhat.com>
0727d3
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
0727d3
0727d3
Signed-off-by: Juan Quintela <quintela@redhat.com>
0727d3
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
0727d3
(cherry picked from commit 0a818b89eb8eaf79ae651405907d8110a0935cfd)
0727d3
Signed-off-by: Leonardo Bras <leobras@redhat.com>
0727d3
---
0727d3
 migration/multifd-zstd.c | 8 ++++----
0727d3
 1 file changed, 4 insertions(+), 4 deletions(-)
0727d3
0727d3
diff --git a/migration/multifd-zstd.c b/migration/multifd-zstd.c
0727d3
index 2185a83eac..4e60cdbc54 100644
0727d3
--- a/migration/multifd-zstd.c
0727d3
+++ b/migration/multifd-zstd.c
0727d3
@@ -156,6 +156,9 @@ static int zstd_send_prepare(MultiFDSendParams *p, Error **errp)
0727d3
             return -1;
0727d3
         }
0727d3
     }
0727d3
+    p->iov[p->iovs_num].iov_base = z->zbuff;
0727d3
+    p->iov[p->iovs_num].iov_len = z->out.pos;
0727d3
+    p->iovs_num++;
0727d3
     p->next_packet_size = z->out.pos;
0727d3
     p->flags |= MULTIFD_FLAG_ZSTD;
0727d3
 
0727d3
@@ -175,10 +178,7 @@ static int zstd_send_prepare(MultiFDSendParams *p, Error **errp)
0727d3
  */
0727d3
 static int zstd_send_write(MultiFDSendParams *p, uint32_t used, Error **errp)
0727d3
 {
0727d3
-    struct zstd_data *z = p->data;
0727d3
-
0727d3
-    return qio_channel_write_all(p->c, (void *)z->zbuff, p->next_packet_size,
0727d3
-                                 errp);
0727d3
+    return qio_channel_writev_all(p->c, p->iov, p->iovs_num, errp);
0727d3
 }
0727d3
 
0727d3
 /**
0727d3
-- 
0727d3
2.35.3
0727d3