aboutsummaryrefslogtreecommitdiff
path: root/include/block
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>2023-05-04 13:57:46 +0200
committerKevin Wolf <kwolf@redhat.com>2023-05-10 14:16:54 +0200
commit840428a2669c90f75cf0d26a06bdfe6f51755fae (patch)
tree6fb540d83417aa37ed31349eb72b06d05b910c87 /include/block
parentcb2bfaa450dd65b717e27c9090169be05bd73b93 (diff)
downloadqemu-840428a2669c90f75cf0d26a06bdfe6f51755fae.zip
qemu-840428a2669c90f75cf0d26a06bdfe6f51755fae.tar.gz
qemu-840428a2669c90f75cf0d26a06bdfe6f51755fae.tar.bz2
block: Mark BlockDriver callbacks for amend job GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of amend callbacks in BlockDriver need to hold a reader lock for the graph. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> 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-17-kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r--include/block/block_int-common.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h
index 88ce7f9..37d0947 100644
--- a/include/block/block_int-common.h
+++ b/include/block/block_int-common.h
@@ -204,12 +204,13 @@ struct BlockDriver {
* to allow driver-specific initialization code that requires
* the BQL, like setting up specific permission flags.
*/
- int (*bdrv_amend_pre_run)(BlockDriverState *bs, Error **errp);
+ int GRAPH_RDLOCK_PTR (*bdrv_amend_pre_run)(
+ BlockDriverState *bs, Error **errp);
/*
* This function is invoked under BQL after .bdrv_co_amend()
* to allow cleaning up what was done in .bdrv_amend_pre_run().
*/
- void (*bdrv_amend_clean)(BlockDriverState *bs);
+ void GRAPH_RDLOCK_PTR (*bdrv_amend_clean)(BlockDriverState *bs);
/*
* Return true if @to_replace can be replaced by a BDS with the
@@ -463,10 +464,9 @@ struct BlockDriver {
int (*bdrv_probe)(const uint8_t *buf, int buf_size, const char *filename);
- int coroutine_fn (*bdrv_co_amend)(BlockDriverState *bs,
- BlockdevAmendOptions *opts,
- bool force,
- Error **errp);
+ int coroutine_fn GRAPH_RDLOCK_PTR (*bdrv_co_amend)(
+ BlockDriverState *bs, BlockdevAmendOptions *opts, bool force,
+ Error **errp);
/* aio */
BlockAIOCB * GRAPH_RDLOCK_PTR (*bdrv_aio_preadv)(BlockDriverState *bs,