aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2023-06-13 16:57:44 +0200
committerJuan Quintela <quintela@redhat.com>2023-10-17 22:14:51 +0200
commit809f188a1a874ead74a784977e15dec33100891e (patch)
tree729be2255c604f209ef3fdc81aa362ae3f6a437e /migration
parentb88a3306fdfc768f09b2f2a56b739f3d054ce776 (diff)
migration: Move compression_counters cleanup ram-compress.c
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Lukas Straub <lukasstraub2@web.de> Message-ID: <20230613145757.10131-6-quintela@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/migration.c4
-rw-r--r--migration/ram-compress.c5
2 files changed, 6 insertions, 3 deletions
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);