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 <kwolf@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
John Snow 2015-06-10 13:24:54 -04:00 committed by Kevin Wolf
parent 5270b6a0d0
commit 06207b0ff5
1 changed files with 1 additions and 3 deletions

View File

@ -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;
}