qemu-block
[Top][All Lists]
Advanced

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

[Qemu-block] [PULL 10/25] block: Change bitmap truncate conditional to a


From: Kevin Wolf
Subject: [Qemu-block] [PULL 10/25] block: Change bitmap truncate conditional to assertion
Date: Fri, 12 Jun 2015 18:23:19 +0200

From: John Snow <address@hidden>

This is an artifact of an older version that had both all-bitmap and
single-bitmap truncate functions, and some info got lost in the shuffle.

Bitmaps can only be frozen during a backup operation, and a backup
operation should prevent a resize operation, so just assert that this
cannot happen.

Suggested-by: Kevin Wolf <address@hidden>
Signed-off-by: John Snow <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
 block.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/block.c b/block.c
index 2786e47..4ea2c4f 100644
--- a/block.c
+++ b/block.c
@@ -3220,9 +3220,7 @@ static void bdrv_dirty_bitmap_truncate(BlockDriverState 
*bs)
     uint64_t size = bdrv_nb_sectors(bs);
 
     QLIST_FOREACH(bitmap, &bs->dirty_bitmaps, list) {
-        if (bdrv_dirty_bitmap_frozen(bitmap)) {
-            continue;
-        }
+        assert(!bdrv_dirty_bitmap_frozen(bitmap));
         hbitmap_truncate(bitmap->bitmap, size);
         bitmap->size = size;
     }
-- 
1.8.3.1




reply via email to

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