From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2jkM-00053o-W3 for qemu-devel@nongnu.org; Wed, 10 Jun 2015 13:25:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2jkM-0003YQ-2n for qemu-devel@nongnu.org; Wed, 10 Jun 2015 13:25:02 -0400 From: John Snow Date: Wed, 10 Jun 2015 13:24:54 -0400 Message-Id: <1433957094-8303-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH] block: Change bitmap truncate conditional to assertion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, John Snow , qemu-devel@nongnu.org Requires: 1433796555-5608-1-git-send-email-jsnow@redhat.com [PATCH] block: record new size in bdrv_dirty_bitmap_truncate 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 --- 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; } -- 2.1.0