aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2023-09-29 16:51:52 +0200
committerKevin Wolf <kwolf@redhat.com>2023-10-12 16:31:33 +0200
commit277f2007ce187a6ff467579cb016824f80a2be10 (patch)
tree9e9a3b9921ce129649723140e17262c659f51ab0 /include
parent5155853e90388d9c8c5370bcbe1b6484a92ee710 (diff)
downloadqemu-277f2007ce187a6ff467579cb016824f80a2be10.zip
qemu-277f2007ce187a6ff467579cb016824f80a2be10.tar.gz
qemu-277f2007ce187a6ff467579cb016824f80a2be10.tar.bz2
block: Mark bdrv_op_is_blocked() and callers GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_op_is_blocked() need to hold a reader lock for the graph because it calls bdrv_get_device_or_node_name(), which accesses the parents list of a node. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-ID: <20230929145157.45443-18-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.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/block/block-global-state.h b/include/block/block-global-state.h
index 794ef34..6bfafe7 100644
--- a/include/block/block-global-state.h
+++ b/include/block/block-global-state.h
@@ -246,7 +246,9 @@ bdrv_attach_child(BlockDriverState *parent_bs,
BdrvChildRole child_role,
Error **errp);
-bool bdrv_op_is_blocked(BlockDriverState *bs, BlockOpType op, Error **errp);
+bool GRAPH_RDLOCK
+bdrv_op_is_blocked(BlockDriverState *bs, BlockOpType op, Error **errp);
+
void bdrv_op_block(BlockDriverState *bs, BlockOpType op, Error *reason);
void bdrv_op_unblock(BlockDriverState *bs, BlockOpType op, Error *reason);
void bdrv_op_block_all(BlockDriverState *bs, Error *reason);