diff options
author | Kevin Wolf <kwolf@redhat.com> | 2023-09-29 16:51:48 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-10-12 16:31:33 +0200 |
commit | bd131d6705b6996f2cdccee3db017af570ce91ad (patch) | |
tree | 71c7238864b3f05e9b53407b94ed77085be04713 /include | |
parent | 4026f1c4f320aa072fa4cd299545cbc97315e246 (diff) | |
download | qemu-bd131d6705b6996f2cdccee3db017af570ce91ad.zip qemu-bd131d6705b6996f2cdccee3db017af570ce91ad.tar.gz qemu-bd131d6705b6996f2cdccee3db017af570ce91ad.tar.bz2 |
block: Mark bdrv_amend_options() and callers GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_amend_options() need to hold a reader lock for the graph. This
removes an assume_graph_lock() call in crypto's implementation.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20230929145157.45443-14-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/block-global-state.h | 8 | ||||
-rw-r--r-- | include/block/block_int-common.h | 10 |
2 files changed, 8 insertions, 10 deletions
diff --git a/include/block/block-global-state.h b/include/block/block-global-state.h index ec623ef..9dc3513 100644 --- a/include/block/block-global-state.h +++ b/include/block/block-global-state.h @@ -160,10 +160,10 @@ void bdrv_unfreeze_backing_chain(BlockDriverState *bs, BlockDriverState *base); */ typedef void BlockDriverAmendStatusCB(BlockDriverState *bs, int64_t offset, int64_t total_work_size, void *opaque); -int bdrv_amend_options(BlockDriverState *bs_new, QemuOpts *opts, - BlockDriverAmendStatusCB *status_cb, void *cb_opaque, - bool force, - Error **errp); +int GRAPH_RDLOCK +bdrv_amend_options(BlockDriverState *bs_new, QemuOpts *opts, + BlockDriverAmendStatusCB *status_cb, void *cb_opaque, + bool force, Error **errp); /* check if a named node can be replaced when doing drive-mirror */ BlockDriverState * GRAPH_RDLOCK diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h index be80887..c866177 100644 --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -259,12 +259,10 @@ struct BlockDriver { int coroutine_fn GRAPH_UNLOCKED_PTR (*bdrv_co_create_opts)( BlockDriver *drv, const char *filename, QemuOpts *opts, Error **errp); - int (*bdrv_amend_options)(BlockDriverState *bs, - QemuOpts *opts, - BlockDriverAmendStatusCB *status_cb, - void *cb_opaque, - bool force, - Error **errp); + int GRAPH_RDLOCK_PTR (*bdrv_amend_options)( + BlockDriverState *bs, QemuOpts *opts, + BlockDriverAmendStatusCB *status_cb, void *cb_opaque, + bool force, Error **errp); int (*bdrv_make_empty)(BlockDriverState *bs); |