migration/multifd: correct multifd_send_thread to trace the flags
PATCH 1/1 migration/multifd: correct multifd_send_thread to trace the flags
The p->flags could be updated via the send_prepare callback, e.g. OR-ed with MULTIFD_FLAG_ZLIB via zlib_send_prepare. Assign p->flags to the local "flags" before the send_prepare callback could only get partial of p->flags. Fix it by moving the assignment of p->flags to the local flags after the callback, so that the correct flags can be traced.
--- migration/multifd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
migration/multifd.c +2 -1
@@ -677,7 +677,7 @@ static void *multifd_send_thread(void *opaque)if (p->pending_job) {uint64_t packet_num = p->packet_num; -uint32_t flags = p->flags; +uint32_t flags; p->normal_num =0 ;if (use_zero_copy_send) {
@@ -699,6 +699,7 @@ static void *multifd_send_thread(void *opaque) } }multifd_send_fill_packet (p); + flags = p->flags; p->flags =0 ; p->num_packets++; p->total_normal_pages += p->normal_num;
Signature · 1 line
2.27.0
Quoted 8 lines · Wei Wang
The
p->flagscould be updated via thesend_preparecallback, e.g. OR-ed withMULTIFD_FLAG_ZLIBviazlib_send_prepare. Assignp->flagsto the local "flags" before thesend_preparecallback could only get partial ofp->flags. Fix it by moving the assignment ofp->flagsto the local flags after the callback, so that the correct flags can be traced.Fixes ab7cbb0b9a3b ("multifd: Make no compression operations into its own structure")Signed-off-by Wei Wang <[email protected]>
Good catch. Thanks.
queued.