[Top][All Lists]

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

Re: [Qemu-devel] [PATCH RFC v2 8/8] migration: add migration/dirty-bitma

From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-devel] [PATCH RFC v2 8/8] migration: add migration/dirty-bitmap.c
Date: Fri, 13 Feb 2015 12:06:45 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

+    blk_mig_reset_dirty_cursor();
+    dirty_phase(f, false);
+    QSIMPLEQ_FOREACH(dbms, &dirty_bitmap_mig_state.dbms_list, entry) {
+        uint8_t flags = DIRTY_BITMAP_MIG_FLAG_DEVICE_NAME |
+                        DIRTY_BITMAP_MIG_FLAG_BITMAP_NAME |
+                        DIRTY_BITMAP_MIG_FLAG_ENABLED;
+        qemu_put_byte(f, flags);
+        qemu_put_name(f, bdrv_get_device_name(dbms->bs));
+        qemu_put_name(f, bdrv_dirty_bitmap_name(dbms->bitmap));
+        qemu_put_byte(f, bdrv_dirty_bitmap_enabled(dbms->bitmap));
+    }
+    qemu_put_byte(f, DIRTY_BITMAP_MIG_FLAG_EOS);
+    DPRINTF("Dirty bitmaps migration completed\n");
+    dirty_bitmap_mig_cleanup();
+    return 0;

I suppose we don't need a flag that distinctly SAYS this is the end section, since we can tell by omission of DIRTY_BITMAP_MIG_FLAG_NORMAL_CHUNK or ZERO_CHUNK.
Hmm. I think it simplifies the logic (to use EOS after each section). And the same approach is in migration/block.c.. It's a question about which format is better: "Each section for dirty_bitmap_load ends with EOS" or "Each section for dirty_bitmap_load ends with EOS except the last one. The last one may be recognized by absent NORMAL_CHUNK and ZERO_CHUNK"

Oh, sorry, no, it's important EOS. There are several blocks with no *_CHUNK! Several bitmaps. And loop in dirty_bitmap_load will read them iteratively, and it will finish when find EOS.

Best regards,

reply via email to

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