From: John Snow Date: Wed, 10 Jun 2015 17:24:54 +0000 (-0400) Subject: block: Change bitmap truncate conditional to assertion X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=06207b0ff596aa4bb192d1fafc593847ed888e39;p=qemu.git block: Change bitmap truncate conditional to assertion 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 Signed-off-by: John Snow Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- diff --git a/block.c b/block.c index 2786e47d1e..4ea2c4f5c8 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; }