diff options
author | John Snow <jsnow@redhat.com> | 2019-03-12 12:05:49 -0400 |
---|---|---|
committer | John Snow <jsnow@redhat.com> | 2019-03-12 12:05:49 -0400 |
commit | c3edf13cd1efdb5a59e0ae4f15e63080ffb35525 (patch) | |
tree | 8d27c8c270cfa612e964dbffb58086b8a6237526 /blockdev.c | |
parent | a54a0c113b333aee49e484758fab7f1f1c593dd3 (diff) |
block/dirty-bitmaps: prohibit removing readonly bitmaps
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 <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-id: 20190301191545.8728-6-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r-- | blockdev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/blockdev.c b/blockdev.c index dd841fc5db..1391f4200a 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2884,7 +2884,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; } |