Blame SOURCES/kvm-block-dirty-bitmaps-allow-clear-on-disabled-bitmaps.patch

7711c0
From 2f1acc04e2744651329f4c9bf2de480923f63a41 Mon Sep 17 00:00:00 2001
7711c0
From: John Snow <jsnow@redhat.com>
7711c0
Date: Wed, 6 Feb 2019 22:12:33 +0100
7711c0
Subject: [PATCH 23/33] block/dirty-bitmaps: allow clear on disabled bitmaps
7711c0
7711c0
RH-Author: John Snow <jsnow@redhat.com>
7711c0
Message-id: <20190206221243.7407-14-jsnow@redhat.com>
7711c0
Patchwork-id: 84266
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH v2 13/23] block/dirty-bitmaps: allow clear on disabled bitmaps
7711c0
Bugzilla: 1658343
7711c0
RH-Acked-by: Thomas Huth <thuth@redhat.com>
7711c0
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
7711c0
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
7711c0
7711c0
Similarly to merge, it's OK to allow clear operations on disabled
7711c0
bitmaps, as this condition only means that they are not recording
7711c0
new writes. We are free to clear it if the user requests it.
7711c0
7711c0
Signed-off-by: John Snow <jsnow@redhat.com>
7711c0
Reviewed-by: Eric Blake <eblake@redhat.com>
7711c0
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
7711c0
Message-id: 20181002230218.13949-4-jsnow@redhat.com
7711c0
Signed-off-by: John Snow <jsnow@redhat.com>
7711c0
(cherry picked from commit 0be37c9e19f541643ef407bdafe0282b667ec23c)
7711c0
Signed-off-by: John Snow <jsnow@redhat.com>
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 block/dirty-bitmap.c | 1 -
7711c0
 blockdev.c           | 8 --------
7711c0
 2 files changed, 9 deletions(-)
7711c0
7711c0
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
7711c0
index 8c7dc60..db8021a 100644
7711c0
--- a/block/dirty-bitmap.c
7711c0
+++ b/block/dirty-bitmap.c
7711c0
@@ -625,7 +625,6 @@ void bdrv_reset_dirty_bitmap(BdrvDirtyBitmap *bitmap,
7711c0
 
7711c0
 void bdrv_clear_dirty_bitmap(BdrvDirtyBitmap *bitmap, HBitmap **out)
7711c0
 {
7711c0
-    assert(bdrv_dirty_bitmap_enabled(bitmap));
7711c0
     assert(!bdrv_dirty_bitmap_readonly(bitmap));
7711c0
     bdrv_dirty_bitmap_lock(bitmap);
7711c0
     if (!out) {
7711c0
diff --git a/blockdev.c b/blockdev.c
7711c0
index 6cf7654..7300f01 100644
7711c0
--- a/blockdev.c
7711c0
+++ b/blockdev.c
7711c0
@@ -2164,9 +2164,6 @@ static void block_dirty_bitmap_clear_prepare(BlkActionState *common,
7711c0
     if (bdrv_dirty_bitmap_user_locked(state->bitmap)) {
7711c0
         error_setg(errp, "Cannot modify a bitmap in use by another operation");
7711c0
         return;
7711c0
-    } else if (!bdrv_dirty_bitmap_enabled(state->bitmap)) {
7711c0
-        error_setg(errp, "Cannot clear a disabled bitmap");
7711c0
-        return;
7711c0
     } else if (bdrv_dirty_bitmap_readonly(state->bitmap)) {
7711c0
         error_setg(errp, "Cannot clear a readonly bitmap");
7711c0
         return;
7711c0
@@ -3069,11 +3066,6 @@ void qmp_block_dirty_bitmap_clear(const char *node, const char *name,
7711c0
                    "Bitmap '%s' is currently in use by another operation"
7711c0
                    " and cannot be cleared", name);
7711c0
         return;
7711c0
-    } else if (!bdrv_dirty_bitmap_enabled(bitmap)) {
7711c0
-        error_setg(errp,
7711c0
-                   "Bitmap '%s' is currently disabled and cannot be cleared",
7711c0
-                   name);
7711c0
-        return;
7711c0
     } else if (bdrv_dirty_bitmap_readonly(bitmap)) {
7711c0
         error_setg(errp, "Bitmap '%s' is readonly and cannot be cleared", name);
7711c0
         return;
7711c0
-- 
7711c0
1.8.3.1
7711c0