summaryrefslogtreecommitdiffstats
path: root/include/block
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy2019-09-20 10:25:43 +0200
committerJohn Snow2019-10-17 23:02:32 +0200
commitd2c3080e41fd2c9bc36c996cc9d33804462ba803 (patch)
treefaa16eec6452d036d5762ca0329a4ecdcb0b1ab2 /include/block
parentblock/dirty-bitmap: return int from bdrv_remove_persistent_dirty_bitmap (diff)
downloadqemu-d2c3080e41fd2c9bc36c996cc9d33804462ba803.tar.gz
qemu-d2c3080e41fd2c9bc36c996cc9d33804462ba803.tar.xz
qemu-d2c3080e41fd2c9bc36c996cc9d33804462ba803.zip
block/qcow2: proper locking on bitmap add/remove paths
qmp_block_dirty_bitmap_add and do_block_dirty_bitmap_remove do acquire aio context since 0a6c86d024c52b. But this is not enough: we also must lock qcow2 mutex when access in-image metadata. Especially it concerns freeing qcow2 clusters. To achieve this, move qcow2_can_store_new_dirty_bitmap and qcow2_remove_persistent_dirty_bitmap to coroutine context. Since we work in coroutines in correct aio context, we don't need context acquiring in blockdev.c anymore, drop it. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20190920082543.23444-4-vsementsov@virtuozzo.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r--include/block/block_int.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 6b511dd889..32fb493cbb 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -553,13 +553,13 @@ struct BlockDriver {
* field of BlockDirtyBitmap's in case of success.
*/
int (*bdrv_reopen_bitmaps_rw)(BlockDriverState *bs, Error **errp);
- bool (*bdrv_can_store_new_dirty_bitmap)(BlockDriverState *bs,
- const char *name,
- uint32_t granularity,
- Error **errp);
- int (*bdrv_remove_persistent_dirty_bitmap)(BlockDriverState *bs,
+ bool (*bdrv_co_can_store_new_dirty_bitmap)(BlockDriverState *bs,
const char *name,
+ uint32_t granularity,
Error **errp);
+ int (*bdrv_co_remove_persistent_dirty_bitmap)(BlockDriverState *bs,
+ const char *name,
+ Error **errp);
/**
* Register/unregister a buffer for I/O. For example, when the driver is