mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
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>
This commit is contained in:
parent
283d7a04f2
commit
0be37c9e19
2 changed files with 0 additions and 9 deletions
|
@ -625,7 +625,6 @@ void bdrv_reset_dirty_bitmap(BdrvDirtyBitmap *bitmap,
|
||||||
|
|
||||||
void bdrv_clear_dirty_bitmap(BdrvDirtyBitmap *bitmap, HBitmap **out)
|
void bdrv_clear_dirty_bitmap(BdrvDirtyBitmap *bitmap, HBitmap **out)
|
||||||
{
|
{
|
||||||
assert(bdrv_dirty_bitmap_enabled(bitmap));
|
|
||||||
assert(!bdrv_dirty_bitmap_readonly(bitmap));
|
assert(!bdrv_dirty_bitmap_readonly(bitmap));
|
||||||
bdrv_dirty_bitmap_lock(bitmap);
|
bdrv_dirty_bitmap_lock(bitmap);
|
||||||
if (!out) {
|
if (!out) {
|
||||||
|
|
|
@ -2013,9 +2013,6 @@ static void block_dirty_bitmap_clear_prepare(BlkActionState *common,
|
||||||
if (bdrv_dirty_bitmap_user_locked(state->bitmap)) {
|
if (bdrv_dirty_bitmap_user_locked(state->bitmap)) {
|
||||||
error_setg(errp, "Cannot modify a bitmap in use by another operation");
|
error_setg(errp, "Cannot modify a bitmap in use by another operation");
|
||||||
return;
|
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)) {
|
} else if (bdrv_dirty_bitmap_readonly(state->bitmap)) {
|
||||||
error_setg(errp, "Cannot clear a readonly bitmap");
|
error_setg(errp, "Cannot clear a readonly bitmap");
|
||||||
return;
|
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"
|
"Bitmap '%s' is currently in use by another operation"
|
||||||
" and cannot be cleared", name);
|
" and cannot be cleared", name);
|
||||||
return;
|
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)) {
|
} else if (bdrv_dirty_bitmap_readonly(bitmap)) {
|
||||||
error_setg(errp, "Bitmap '%s' is readonly and cannot be cleared", name);
|
error_setg(errp, "Bitmap '%s' is readonly and cannot be cleared", name);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue