diff mbox series

[PULL,02/11] migration: Move compression_counters cleanup ram-compress.c

Message ID 20231018100651.32674-3-quintela@redhat.com
State New
Headers show
Series [PULL,01/11] migration: RDMA is not compatible with anything else | expand

Commit Message

Juan Quintela Oct. 18, 2023, 10:06 a.m. UTC
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Message-ID: <20230613145757.10131-6-quintela@redhat.com>
---
 migration/migration.c    | 4 +---
 migration/ram-compress.c | 5 +++++
 2 files changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/migration/migration.c b/migration/migration.c
index 81862fcaa9..a808abd294 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1466,11 +1466,9 @@  int migrate_init(MigrationState *s, Error **errp)
     s->switchover_acked = false;
     s->rdma_migration = false;
     /*
-     * set mig_stats compression_counters memory to zero for a
-     * new migration
+     * set mig_stats memory to zero for a new migration
      */
     memset(&mig_stats, 0, sizeof(mig_stats));
-    memset(&compression_counters, 0, sizeof(compression_counters));
     migration_reset_vfio_bytes_transferred();
 
     return 0;
diff --git a/migration/ram-compress.c b/migration/ram-compress.c
index 06254d8c69..a0f6a56470 100644
--- a/migration/ram-compress.c
+++ b/migration/ram-compress.c
@@ -430,6 +430,11 @@  int compress_threads_load_setup(QEMUFile *f)
         return 0;
     }
 
+    /*
+     * set compression_counters memory to zero for a new migration
+     */
+    memset(&compression_counters, 0, sizeof(compression_counters));
+
     thread_count = migrate_decompress_threads();
     decompress_threads = g_new0(QemuThread, thread_count);
     decomp_param = g_new0(DecompressParam, thread_count);