aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2018-10-29 16:23:16 -0400
committerJohn Snow <jsnow@redhat.com>2018-10-29 16:23:16 -0400
commit0be37c9e19f541643ef407bdafe0282b667ec23c (patch)
tree52d7c4eab4a5508b8b45861214ccc17346b8134d /blockdev.c
parent283d7a04f2addcc51468635300208b60c19a0db3 (diff)
downloadqemu-0be37c9e19f541643ef407bdafe0282b667ec23c.zip
qemu-0be37c9e19f541643ef407bdafe0282b667ec23c.tar.gz
qemu-0be37c9e19f541643ef407bdafe0282b667ec23c.tar.bz2
block/dirty-bitmaps: allow clear on disabled bitmaps
Similarly to merge, it's OK to allow clear operations on disabled bitmaps, as this condition only means that they are not recording new writes. We are free to clear it if the user requests it. 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: 20181002230218.13949-4-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/blockdev.c b/blockdev.c
index 9da0cf1..8970f69 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2013,9 +2013,6 @@ static void block_dirty_bitmap_clear_prepare(BlkActionState *common,
if (bdrv_dirty_bitmap_user_locked(state->bitmap)) {
error_setg(errp, "Cannot modify a bitmap in use by another operation");
return;
- } else if (!bdrv_dirty_bitmap_enabled(state->bitmap)) {
- error_setg(errp, "Cannot clear a disabled bitmap");
- return;
} else if (bdrv_dirty_bitmap_readonly(state->bitmap)) {
error_setg(errp, "Cannot clear a readonly bitmap");
return;
@@ -2918,11 +2915,6 @@ void qmp_block_dirty_bitmap_clear(const char *node, const char *name,
"Bitmap '%s' is currently in use by another operation"
" and cannot be cleared", name);
return;
- } else if (!bdrv_dirty_bitmap_enabled(bitmap)) {
- error_setg(errp,
- "Bitmap '%s' is currently disabled and cannot be cleared",
- name);
- return;
} else if (bdrv_dirty_bitmap_readonly(bitmap)) {
error_setg(errp, "Bitmap '%s' is readonly and cannot be cleared", name);
return;