All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: Change bitmap truncate conditional to assertion
@ 2015-06-10 17:24 John Snow
  2015-06-10 20:52 ` Eric Blake
  0 siblings, 1 reply; 4+ messages in thread
From: John Snow @ 2015-06-10 17:24 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, vsementsov, John Snow, qemu-devel

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 <kwolf@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-11  8:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-10 17:24 [Qemu-devel] [PATCH] block: Change bitmap truncate conditional to assertion John Snow
2015-06-10 20:52 ` Eric Blake
2015-06-10 20:55   ` John Snow
2015-06-11  8:26     ` Kevin Wolf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.