aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2019-03-12 12:05:49 -0400
committerJohn Snow <jsnow@redhat.com>2019-03-12 12:05:49 -0400
commitcb8e58e3de1a0f39c60de272faa0133b98b02cb5 (patch)
tree7d5d90ac1cd50fa5b2005e37f4a6e79599929859 /block
parentc3edf13cd1efdb5a59e0ae4f15e63080ffb35525 (diff)
downloadqemu-cb8e58e3de1a0f39c60de272faa0133b98b02cb5.zip
qemu-cb8e58e3de1a0f39c60de272faa0133b98b02cb5.tar.gz
qemu-cb8e58e3de1a0f39c60de272faa0133b98b02cb5.tar.bz2
block/dirty-bitmaps: disallow busy bitmaps as merge source
We didn't do any state checking on source bitmaps at all, so this adds inconsistent and busy checks. readonly is allowed, so you can still copy a readonly bitmap to a new destination to use it for operations like drive-backup. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 20190301191545.8728-7-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/dirty-bitmap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
index 6170f3a..2139354 100644
--- a/block/dirty-bitmap.c
+++ b/block/dirty-bitmap.c
@@ -825,6 +825,9 @@ void bdrv_merge_dirty_bitmap(BdrvDirtyBitmap *dest, const BdrvDirtyBitmap *src,
goto out;
}
+ if (bdrv_dirty_bitmap_check(src, BDRV_BITMAP_ALLOW_RO, errp)) {
+ goto out;
+ }
if (!hbitmap_can_merge(dest->bitmap, src->bitmap)) {
error_setg(errp, "Bitmaps are incompatible and can't be merged");