qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 08/22] migration/block-dirty-bitmap: keep bitmap state for


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH v2 08/22] migration/block-dirty-bitmap: keep bitmap state for all bitmaps
Date: Fri, 24 Jul 2020 08:18:19 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

24.07.2020 00:30, Eric Blake wrote:
On 2/17/20 9:02 AM, Vladimir Sementsov-Ogievskiy wrote:
Keep bitmap state for disabled bitmaps too. Keep the state until the
end of the process. It's needed for the following commit to implement
bitmap postcopy canceling.

To clean-up the new list the following logic is used:
We need two events to consider bitmap migration finished:
1. chunk with DIRTY_BITMAP_MIG_FLAG_COMPLETE flag should be received
2. dirty_bitmap_mig_before_vm_start should be called
These two events may come in any order, so we understand which one is
last, and on the last of them we remove bitmap migration state from the
list.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
  migration/block-dirty-bitmap.c | 64 +++++++++++++++++++++++-----------
  1 file changed, 43 insertions(+), 21 deletions(-)

@@ -484,45 +488,59 @@ static int dirty_bitmap_load_start(QEMUFile *f, 
DBMLoadState *s)
      bdrv_disable_dirty_bitmap(s->bitmap);
      if (flags & DIRTY_BITMAP_MIG_START_FLAG_ENABLED) {
-        LoadBitmapState *b;
-
          bdrv_dirty_bitmap_create_successor(s->bitmap, &local_err);
          if (local_err) {
              error_report_err(local_err);
              return -EINVAL;
          }
-
-        b = g_new(LoadBitmapState, 1);
-        b->bs = s->bs;
-        b->bitmap = s->bitmap;
-        b->migrated = false;
-        s->enabled_bitmaps = g_slist_prepend(s->enabled_bitmaps, b);
      }
+    b = g_new(LoadBitmapState, 1);
+    b->bs = s->bs;
+    b->bitmap = s->bitmap;
+    b->migrated = false;
+    b->enabled = flags & DIRTY_BITMAP_MIG_START_FLAG_ENABLED,
+
+    s->bitmaps = g_slist_prepend(s->bitmaps, b);

Did you really mean to use a comma operator there, or should that be ';'?


Of course, it should be ';':)

--
Best regards,
Vladimir



reply via email to

[Prev in Thread] Current Thread [Next in Thread]