diff options
| author | John Snow | 2015-06-10 19:24:54 +0200 |
|---|---|---|
| committer | Kevin Wolf | 2015-06-12 15:54:01 +0200 |
| commit | 06207b0ff596aa4bb192d1fafc593847ed888e39 (patch) | |
| tree | a40caaf49f583b6a594d0cfd6d3108c17b4cfd3a | |
| parent | block: record new size in bdrv_dirty_bitmap_truncate (diff) | |
| download | qemu-06207b0ff596aa4bb192d1fafc593847ed888e39.tar.gz qemu-06207b0ff596aa4bb192d1fafc593847ed888e39.tar.xz qemu-06207b0ff596aa4bb192d1fafc593847ed888e39.zip | |
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>
| -rw-r--r-- | block.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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; } |
