thebeanogamer / rpms / qemu-kvm

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