Skip to content

Commit

Permalink
migration: Move compression_counters cleanup ram-compress.c
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Message-ID: <20230613145757.10131-6-quintela@redhat.com>
  • Loading branch information
Juan Quintela committed Oct 17, 2023
1 parent b88a330 commit 809f188
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions migration/migration.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions migration/ram-compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 809f188

Please sign in to comment.