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