Blame SOURCES/kvm-block-dirty-bitmaps-prohibit-removing-readonly-bitma.patch

7711c0
From 87a49b51dcddd2f779fbc387d83f182870fdcaa8 Mon Sep 17 00:00:00 2001
7711c0
From: John Snow <jsnow@redhat.com>
7711c0
Date: Wed, 3 Apr 2019 18:18:53 +0200
7711c0
Subject: [PATCH 148/163] block/dirty-bitmaps: prohibit removing readonly
7711c0
 bitmaps
7711c0
7711c0
RH-Author: John Snow <jsnow@redhat.com>
7711c0
Message-id: <20190403181857.9693-18-jsnow@redhat.com>
7711c0
Patchwork-id: 85413
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 17/21] block/dirty-bitmaps: prohibit removing readonly bitmaps
7711c0
Bugzilla: 1677073
7711c0
RH-Acked-by: Max Reitz <mreitz@redhat.com>
7711c0
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
7711c0
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
7711c0
7711c0
Remove is an inherently RW operation, so this will fail anyway, but
7711c0
we can fail it very quickly instead of trying and failing, so do so.
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: 20190301191545.8728-6-jsnow@redhat.com
7711c0
Signed-off-by: John Snow <jsnow@redhat.com>
7711c0
(cherry picked from commit c3edf13cd1efdb5a59e0ae4f15e63080ffb35525)
7711c0
Signed-off-by: John Snow <jsnow@redhat.com>
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 blockdev.c | 3 ++-
7711c0
 1 file changed, 2 insertions(+), 1 deletion(-)
7711c0
7711c0
diff --git a/blockdev.c b/blockdev.c
7711c0
index de8a2bf..e497939 100644
7711c0
--- a/blockdev.c
7711c0
+++ b/blockdev.c
7711c0
@@ -3034,7 +3034,8 @@ void qmp_block_dirty_bitmap_remove(const char *node, const char *name,
7711c0
         return;
7711c0
     }
7711c0
 
7711c0
-    if (bdrv_dirty_bitmap_check(bitmap, BDRV_BITMAP_BUSY, errp)) {
7711c0
+    if (bdrv_dirty_bitmap_check(bitmap, BDRV_BITMAP_BUSY | BDRV_BITMAP_RO,
7711c0
+                                errp)) {
7711c0
         return;
7711c0
     }
7711c0
 
7711c0
-- 
7711c0
1.8.3.1
7711c0