diff mbox series

[RFC,v2,1/6] dirty-bitmaps: allow merging to disabled bitmaps

Message ID 20180921222847.1012-2-jsnow@redhat.com
State New
Headers show
Series dirty-bitmaps: fix QMP command permissions | expand

Commit Message

John Snow Sept. 21, 2018, 10:28 p.m. UTC
We wish to prohibit merging to read-only bitmaps and frozen bitmaps,
but "disabled" bitmaps only preclude their recording of live, new
information. It does not prohibit them from manual writes at the behest
of the user, as is the case for merge operations.

Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
---
 block/dirty-bitmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
index c9b8a6fd52..fa7e75e0af 100644
--- a/block/dirty-bitmap.c
+++ b/block/dirty-bitmap.c
@@ -798,7 +798,7 @@  void bdrv_merge_dirty_bitmap(BdrvDirtyBitmap *dest, const BdrvDirtyBitmap *src,
 
     qemu_mutex_lock(dest->mutex);
 
-    assert(bdrv_dirty_bitmap_enabled(dest));
+    assert(!bdrv_dirty_bitmap_frozen(dest));
     assert(!bdrv_dirty_bitmap_readonly(dest));
 
     if (!hbitmap_merge(dest->bitmap, src->bitmap)) {