[Top][All Lists]

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

[Qemu-devel] [PATCH 1/1] block: fix libvirt snapshot with existing bitma

From: Denis V. Lunev
Subject: [Qemu-devel] [PATCH 1/1] block: fix libvirt snapshot with existing bitmaps
Date: Mon, 13 Jun 2016 15:38:55 +0300

From: Vladimir Sementsov-Ogievskiy <address@hidden>

Fix the following bug:

 # virsh start test
 Domain test started

 #  virsh qemu-monitor-command test \

 # virsh snapshot-create test
 error: Unable to read from monitor: Connection reset by peer

Actually, assert "assert(pos < hb->size)" in hbitmap_iter_init fires,
because qcow2_save_vmstate just writes to bs (not to bs->file->bs) after
the end of the drive.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: Denis V. Lunev <address@hidden>
CC: Kevin Wolf <address@hidden>
CC: Max Reitz <address@hidden>
 block/dirty-bitmap.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
index 4902ca5..7b636ee 100644
--- a/block/dirty-bitmap.c
+++ b/block/dirty-bitmap.c
@@ -364,6 +364,11 @@ void bdrv_set_dirty(BlockDriverState *bs, int64_t 
                     int nr_sectors)
     BdrvDirtyBitmap *bitmap;
+    if (cur_sector >= bdrv_nb_sectors(bs)) {
+        return;
+    }
     QLIST_FOREACH(bitmap, &bs->dirty_bitmaps, list) {
         if (!bdrv_dirty_bitmap_enabled(bitmap)) {

reply via email to

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