mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
block: Mark bdrv_first_blk() and bdrv_is_root_node() GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_first_blk() and bdrv_is_root_node() need to hold a reader lock for the graph. These functions are the only functions in block-backend.c that access the parent list of a node. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-ID: <20230929145157.45443-5-kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
0e6bad1f21
commit
2b3912f135
14 changed files with 53 additions and 13 deletions
|
@ -59,8 +59,8 @@ BlockBackend *blk_by_public(BlockBackendPublic *public);
|
|||
void blk_remove_bs(BlockBackend *blk);
|
||||
int blk_insert_bs(BlockBackend *blk, BlockDriverState *bs, Error **errp);
|
||||
int blk_replace_bs(BlockBackend *blk, BlockDriverState *new_bs, Error **errp);
|
||||
bool bdrv_has_blk(BlockDriverState *bs);
|
||||
bool bdrv_is_root_node(BlockDriverState *bs);
|
||||
bool GRAPH_RDLOCK bdrv_has_blk(BlockDriverState *bs);
|
||||
bool GRAPH_RDLOCK bdrv_is_root_node(BlockDriverState *bs);
|
||||
int GRAPH_UNLOCKED blk_set_perm(BlockBackend *blk, uint64_t perm,
|
||||
uint64_t shared_perm, Error **errp);
|
||||
void blk_get_perm(BlockBackend *blk, uint64_t *perm, uint64_t *shared_perm);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue