@@ -798,6 +798,7 @@ void bdrv_merge_dirty_bitmap(BdrvDirtyBitmap *dest, const BdrvDirtyBitmap *src,
qemu_mutex_lock(dest->mutex);
assert(!bdrv_dirty_bitmap_frozen(dest));
+ assert(!bdrv_dirty_bitmap_qmp_locked(dest));
assert(!bdrv_dirty_bitmap_readonly(dest));
if (!hbitmap_merge(dest->bitmap, src->bitmap)) {
@@ -2955,6 +2955,10 @@ void qmp_x_block_dirty_bitmap_merge(const char *node, const char *dst_name,
error_setg(errp, "Bitmap '%s' is readonly and cannot be modified",
dst_name);
return;
+ } else if (bdrv_dirty_bitmap_qmp_locked(dst)) {
+ error_setg(errp, "Bitmap '%s' is in-use by an operation "
+ "and cannot be modified", dst_name);
+ return;
}
src = bdrv_find_dirty_bitmap(bs, src_name);
Like frozen, "qmp locked" bitmaps must not be modified by the user. Signed-off-by: John Snow <jsnow@redhat.com> --- block/dirty-bitmap.c | 1 + blockdev.c | 4 ++++ 2 files changed, 5 insertions(+)