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