mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 15:15:46 +00:00
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>
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user