diff options
author | Kevin Wolf <kwolf@redhat.com> | 2023-05-04 13:57:33 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-05-10 14:16:53 +0200 |
commit | b2ab5f545fa1eaaf2955dd617bee19a8b3279786 (patch) | |
tree | 8aca0214ad2c853a0488681dc07270f3b8512978 /include | |
parent | da4afaff074e56b0fa0d25abf865784148018895 (diff) | |
download | qemu-b2ab5f545fa1eaaf2955dd617bee19a8b3279786.zip qemu-b2ab5f545fa1eaaf2955dd617bee19a8b3279786.tar.gz qemu-b2ab5f545fa1eaaf2955dd617bee19a8b3279786.tar.bz2 |
block: bdrv/blk_co_unref() for calls in coroutine context
These functions must not be called in coroutine context, because they
need write access to the graph.
Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230504115750.54437-4-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/block-global-state.h | 3 | ||||
-rw-r--r-- | include/sysemu/block-backend-global-state.h | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/include/block/block-global-state.h b/include/block/block-global-state.h index 2c312cc..ec3ddb1 100644 --- a/include/block/block-global-state.h +++ b/include/block/block-global-state.h @@ -218,7 +218,8 @@ void bdrv_img_create(const char *filename, const char *fmt, bool quiet, Error **errp); void bdrv_ref(BlockDriverState *bs); -void bdrv_unref(BlockDriverState *bs); +void no_coroutine_fn bdrv_unref(BlockDriverState *bs); +void coroutine_fn no_co_wrapper bdrv_co_unref(BlockDriverState *bs); void bdrv_unref_child(BlockDriverState *parent, BdrvChild *child); BdrvChild *bdrv_attach_child(BlockDriverState *parent_bs, BlockDriverState *child_bs, diff --git a/include/sysemu/block-backend-global-state.h b/include/sysemu/block-backend-global-state.h index 2b6d27d..fa83f93 100644 --- a/include/sysemu/block-backend-global-state.h +++ b/include/sysemu/block-backend-global-state.h @@ -42,7 +42,10 @@ blk_co_new_open(const char *filename, const char *reference, QDict *options, int blk_get_refcnt(BlockBackend *blk); void blk_ref(BlockBackend *blk); -void blk_unref(BlockBackend *blk); + +void no_coroutine_fn blk_unref(BlockBackend *blk); +void coroutine_fn no_co_wrapper blk_co_unref(BlockBackend *blk); + void blk_remove_all_bs(void); BlockBackend *blk_by_name(const char *name); BlockBackend *blk_next(BlockBackend *blk); |