qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: yuxiating <yuxiating@huawei.com>
To: <quintela@redhat.com>, <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org, eric.fangyi@huawei.com
Subject: [PATCH] migration: initialise compression_counters for a new migration
Date: Thu, 2 Sep 2021 19:51:17 +0800	[thread overview]
Message-ID: <20210902115117.5633-1-yuxiating@huawei.com> (raw)

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>
---
 migration/migration.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/migration/migration.c b/migration/migration.c
index bb909781b7..f20bc560e5 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2252,10 +2252,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;
 }
-- 
2.24.0.windows.2



             reply	other threads:[~2021-09-02 14:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02 11:51 yuxiating [this message]
2021-11-02 15:39 ` [PATCH] migration: initialise compression_counters for a new migration Juan Quintela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210902115117.5633-1-yuxiating@huawei.com \
    --to=yuxiating@huawei.com \
    --cc=dgilbert@redhat.com \
    --cc=eric.fangyi@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).