qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 4/7] migration/block-dirty-bitmap: keep bitmap state for all


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH 4/7] migration/block-dirty-bitmap: keep bitmap state for all bitmaps
Date: Tue, 11 Feb 2020 18:12:15 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

24.01.2020 14:01, Juan Quintela wrote:
Vladimir Sementsov-Ogievskiy <address@hidden> 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.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
-
-        b = g_new(DirtyBitmapLoadBitmapState, 1);
-        b->bs = s->bs;
-        b->bitmap = s->bitmap;
-        b->migrated = false;
-        dbm_load_state.enabled_bitmaps =
-            g_slist_prepend(dbm_load_state.enabled_bitmaps, b);
      }
+ b = g_new(DirtyBitmapLoadBitmapState, 1);
+    *b = (DirtyBitmapLoadBitmapState) {
+        .bs = s->bs,
+        .bitmap = s->bitmap,
+        .migrated = false,
+        .enabled = flags & DIRTY_BITMAP_MIG_START_FLAG_ENABLED,
+    };

What is wrong with:
      b->bs = s->bs;
      b->bitmap = s->bitmap;
      b->migrated = false;
      b->enabled = flags & DIRTY_BITMAP_MIG_START_FLAG_ENABLED;

???

Nothing wrong. Compound literal is a bit better, as it will initialize to zero 
all skipped fields.
Still nothing missed here. The change is actually unrelated to the patch, I can 
drop it.


--
Best regards,
Vladimir



reply via email to

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