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>
This commit is contained in:
Juan Quintela 2023-06-13 16:57:44 +02:00
parent b88a3306fd
commit 809f188a1a
2 changed files with 6 additions and 3 deletions

View File

@ -1466,11 +1466,9 @@ int migrate_init(MigrationState *s, Error **errp)
s->switchover_acked = false; s->switchover_acked = false;
s->rdma_migration = false; s->rdma_migration = false;
/* /*
* set mig_stats compression_counters memory to zero for a * set mig_stats memory to zero for a new migration
* new migration
*/ */
memset(&mig_stats, 0, sizeof(mig_stats)); memset(&mig_stats, 0, sizeof(mig_stats));
memset(&compression_counters, 0, sizeof(compression_counters));
migration_reset_vfio_bytes_transferred(); migration_reset_vfio_bytes_transferred();
return 0; return 0;

View File

@ -430,6 +430,11 @@ int compress_threads_load_setup(QEMUFile *f)
return 0; return 0;
} }
/*
* set compression_counters memory to zero for a new migration
*/
memset(&compression_counters, 0, sizeof(compression_counters));
thread_count = migrate_decompress_threads(); thread_count = migrate_decompress_threads();
decompress_threads = g_new0(QemuThread, thread_count); decompress_threads = g_new0(QemuThread, thread_count);
decomp_param = g_new0(DecompressParam, thread_count); decomp_param = g_new0(DecompressParam, thread_count);