aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>2023-02-03 16:21:57 +0100
committerKevin Wolf <kwolf@redhat.com>2023-02-23 19:49:25 +0100
commitc73ff92c9d00f9aa535044e7348d0330aa94f467 (patch)
tree424d2f09e84f4b24cd4b06b6226afc32394985f4 /block.c
parentc38270692593602c4f57449c802c6cbfc16c6108 (diff)
downloadqemu-c73ff92c9d00f9aa535044e7348d0330aa94f467.zip
qemu-c73ff92c9d00f9aa535044e7348d0330aa94f467.tar.gz
qemu-c73ff92c9d00f9aa535044e7348d0330aa94f467.tar.bz2
block: Mark bdrv_co_is_inserted() and callers GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_co_is_inserted() need to hold a reader lock for the graph. blk_is_inserted() is done as a co_wrapper_mixed_bdrv_rdlock (unlike most other blk_* functions) because it is called a lot from other blk_co_*() functions that already hold the lock. These calls go through blk_is_available(), which becomes a co_wrapper_mixed_bdrv_rdlock, too, for the same reason. Functions that run in a coroutine and can call bdrv_co_is_available() directly are changed to do so, which results in better TSA coverage. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20230203152202.49054-19-kwolf@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block.c b/block.c
index 484f48a..738b420 100644
--- a/block.c
+++ b/block.c
@@ -6826,6 +6826,7 @@ bool coroutine_fn bdrv_co_is_inserted(BlockDriverState *bs)
BlockDriver *drv = bs->drv;
BdrvChild *child;
IO_CODE();
+ assert_bdrv_graph_readable();
if (!drv) {
return false;