diff options
| author | Kevin Wolf <kwolf@redhat.com> | 2023-09-29 16:51:44 +0200 |
|---|---|---|
| committer | Kevin Wolf <kwolf@redhat.com> | 2023-10-12 16:31:33 +0200 |
| commit | 15f3f1fe57cd98ef0f45a25681b7a99dc3be0484 (patch) | |
| tree | fcd6ab02f929bdd98648574a6f96c8ca0c62d6f9 | |
| parent | ce433d2942b78d38d31bdb7845dbf565c9dc1109 (diff) | |
| download | focaccia-qemu-15f3f1fe57cd98ef0f45a25681b7a99dc3be0484.tar.gz focaccia-qemu-15f3f1fe57cd98ef0f45a25681b7a99dc3be0484.zip | |
block: Mark bdrv_get_xdbg_block_graph() and callers GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_get_xdbg_block_graph() need to hold a reader lock for the graph because it accesses the children list of a node. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-ID: <20230929145157.45443-10-kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| -rw-r--r-- | blockdev.c | 2 | ||||
| -rw-r--r-- | include/block/block-global-state.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/blockdev.c b/blockdev.c index 43e0c4ddf2..ff5ee9ff7b 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2846,6 +2846,8 @@ BlockDeviceInfoList *qmp_query_named_block_nodes(bool has_flat, XDbgBlockGraph *qmp_x_debug_query_block_graph(Error **errp) { + GRAPH_RDLOCK_GUARD_MAINLOOP(); + return bdrv_get_xdbg_block_graph(errp); } diff --git a/include/block/block-global-state.h b/include/block/block-global-state.h index 505a0d0c11..4d80b3d554 100644 --- a/include/block/block-global-state.h +++ b/include/block/block-global-state.h @@ -192,7 +192,7 @@ int bdrv_has_zero_init_1(BlockDriverState *bs); int bdrv_has_zero_init(BlockDriverState *bs); BlockDriverState *bdrv_find_node(const char *node_name); BlockDeviceInfoList *bdrv_named_nodes_list(bool flat, Error **errp); -XDbgBlockGraph *bdrv_get_xdbg_block_graph(Error **errp); +XDbgBlockGraph * GRAPH_RDLOCK bdrv_get_xdbg_block_graph(Error **errp); BlockDriverState *bdrv_lookup_bs(const char *device, const char *node_name, Error **errp); |