migration: initialise compression_counters for a new migration

If the compression migration fails or is canceled, the query for the value of
compression_counters during the next compression migration is wrong.

Signed-off-by: yuxiating <yuxiating@huawei.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
yuxiating 2021-09-02 19:51:17 +08:00 committed by Juan Quintela
parent 458fecca80
commit fa0b31d585

View File

@ -2271,10 +2271,11 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc,
migrate_init(s);
/*
* set ram_counters memory to zero for a
* set ram_counters compression_counters memory to zero for a
* new migration
*/
memset(&ram_counters, 0, sizeof(ram_counters));
memset(&compression_counters, 0, sizeof(compression_counters));
return true;
}