diff options
author | Kevin Wolf <kwolf@redhat.com> | 2023-09-29 16:51:55 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-10-12 16:31:33 +0200 |
commit | b59b466071391cb76b39584e1558be2d0797c054 (patch) | |
tree | e086d7ac7fdec76b82c386c6eb946b85cfa4ea55 /include | |
parent | 3574499a1e5e420c3e72d0e283cfb2b13bce672e (diff) | |
download | qemu-b59b466071391cb76b39584e1558be2d0797c054.zip qemu-b59b466071391cb76b39584e1558be2d0797c054.tar.gz qemu-b59b466071391cb76b39584e1558be2d0797c054.tar.bz2 |
block: Protect bs->parents with graph_lock
Almost all functions that access the parent link already take the graph
lock now. Add locking to the remaining user in a test case and finally
annotate the struct field itself as protected by the graph lock.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20230929145157.45443-21-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_int-common.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h index 024262b..0e37acd 100644 --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -1043,7 +1043,7 @@ struct BdrvChild { bool quiesced_parent; QLIST_ENTRY(BdrvChild) next; - QLIST_ENTRY(BdrvChild) next_parent; + QLIST_ENTRY(BdrvChild GRAPH_RDLOCK_PTR) next_parent; }; /* @@ -1180,7 +1180,7 @@ struct BlockDriverState { BdrvChild *backing; BdrvChild *file; - QLIST_HEAD(, BdrvChild) parents; + QLIST_HEAD(, BdrvChild GRAPH_RDLOCK_PTR) parents; QDict *options; QDict *explicit_options; |