summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMaciej S. Szmigiero <maciej.szmigiero@oracle.com>2024-10-29 15:58:15 +0100
committerPeter Xu <peterx@redhat.com>2024-10-31 15:48:18 -0400
commit00b4b216534d84ace7b0583cec70a3aaf256cb25 (patch)
tree7046578cac3bd6f08be52b737e09d18144604955
parentb0350c51955f8581873593385672b40b9ec7eb74 (diff)
downloadfocaccia-qemu-00b4b216534d84ace7b0583cec70a3aaf256cb25.tar.gz
focaccia-qemu-00b4b216534d84ace7b0583cec70a3aaf256cb25.zip
migration/multifd: Zero p->flags before starting filling a packet
This way there aren't stale flags there.

p->flags can't contain SYNC to be sent at the next RAM packet since syncs
are now handled separately in multifd_send_thread.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Link: https://lore.kernel.org/r/1c96b6cdb797e6f035eb1a4ad9bfc24f4c7f5df8.1730203967.git.maciej.szmigiero@oracle.com
Signed-off-by: Peter Xu <peterx@redhat.com>
-rw-r--r--migration/multifd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/migration/multifd.c b/migration/multifd.c
index 697fe86fdf..4374e14a96 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -600,6 +600,7 @@ static void *multifd_send_thread(void *opaque)
          * qatomic_store_release() in multifd_send().
          */
         if (qatomic_load_acquire(&p->pending_job)) {
+            p->flags = 0;
             p->iovs_num = 0;
             assert(!multifd_payload_empty(p->data));
 
@@ -651,7 +652,6 @@ static void *multifd_send_thread(void *opaque)
                 }
                 /* p->next_packet_size will always be zero for a SYNC packet */
                 stat64_add(&mig_stats.multifd_bytes, p->packet_len);
-                p->flags = 0;
             }
 
             qatomic_set(&p->pending_sync, false);