0727d3
From 8c1edb1889ff44506f35fa185d6569b0dd9d7260 Mon Sep 17 00:00:00 2001
0727d3
From: Juan Quintela <quintela@redhat.com>
0727d3
Date: Wed, 18 May 2022 02:52:23 -0300
0727d3
Subject: [PATCH 07/37] multifd: Fill offset and block for reception
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: [7/26] 51a9e6b76af956d63fc735172211d9bf6f0f6f80
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
We were using the iov directly, but we will need this info on the
0727d3
following patch.
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 01102a2ef6c97acc5cc8a2c3bb62b7665a20f51f)
0727d3
Signed-off-by: Leonardo Bras <leobras@redhat.com>
0727d3
---
0727d3
 migration/multifd.c | 2 ++
0727d3
 1 file changed, 2 insertions(+)
0727d3
0727d3
diff --git a/migration/multifd.c b/migration/multifd.c
0727d3
index 55d99a8232..0533da154a 100644
0727d3
--- a/migration/multifd.c
0727d3
+++ b/migration/multifd.c
0727d3
@@ -354,6 +354,7 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp)
0727d3
         return -1;
0727d3
     }
0727d3
 
0727d3
+    p->pages->block = block;
0727d3
     for (i = 0; i < p->pages->num; i++) {
0727d3
         uint64_t offset = be64_to_cpu(packet->offset[i]);
0727d3
 
0727d3
@@ -363,6 +364,7 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp)
0727d3
                        offset, block->used_length);
0727d3
             return -1;
0727d3
         }
0727d3
+        p->pages->offset[i] = offset;
0727d3
         p->pages->iov[i].iov_base = block->host + offset;
0727d3
         p->pages->iov[i].iov_len = page_size;
0727d3
     }
0727d3
-- 
0727d3
2.35.3
0727d3