diff options
author | Emanuele Giuseppe Esposito <eesposit@redhat.com> | 2023-05-04 13:57:45 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-05-10 14:16:54 +0200 |
commit | cb2bfaa450dd65b717e27c9090169be05bd73b93 (patch) | |
tree | b5ba5e723648a398854570d40d0dfbbdfac54002 /include/block/block-io.h | |
parent | a00e70c01241590b6c80dca4ee39b9de0b10097e (diff) | |
download | qemu-cb2bfaa450dd65b717e27c9090169be05bd73b93.zip qemu-cb2bfaa450dd65b717e27c9090169be05bd73b93.tar.gz qemu-cb2bfaa450dd65b717e27c9090169be05bd73b93.tar.bz2 |
block: Mark bdrv_co_debug_event() GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_co_debug_event() need to hold a reader lock for the graph.
Unfortunately we cannot use a co_wrapper_bdrv_rdlock (i.e. make the
coroutine wrapper a no_coroutine_fn), because the function is called
(using the BLKDBG_EVENT macro) by mixed functions that run both in
coroutine and non-coroutine context (for example many of the functions
in qcow2-cluster.c and qcow2-refcount.c).
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-16-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block/block-io.h')
-rw-r--r-- | include/block/block-io.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/block/block-io.h b/include/block/block-io.h index bba7f95..1f612ec 100644 --- a/include/block/block-io.h +++ b/include/block/block-io.h @@ -205,10 +205,11 @@ void *qemu_try_blockalign0(BlockDriverState *bs, size_t size); void bdrv_enable_copy_on_read(BlockDriverState *bs); void bdrv_disable_copy_on_read(BlockDriverState *bs); -void coroutine_fn bdrv_co_debug_event(BlockDriverState *bs, - BlkdebugEvent event); -void co_wrapper_mixed bdrv_debug_event(BlockDriverState *bs, - BlkdebugEvent event); +void coroutine_fn GRAPH_RDLOCK +bdrv_co_debug_event(BlockDriverState *bs, BlkdebugEvent event); + +void co_wrapper_mixed_bdrv_rdlock +bdrv_debug_event(BlockDriverState *bs, BlkdebugEvent event); #define BLKDBG_EVENT(child, evt) \ do { \ |