mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
block: Protect bs->children with graph_lock
Almost all functions that access the child links already take the graph lock now. Add locking to the remaining users 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-22-kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
b59b466071
commit
680e0cc40c
4 changed files with 10 additions and 3 deletions
|
@ -1042,7 +1042,7 @@ struct BdrvChild {
|
|||
*/
|
||||
bool quiesced_parent;
|
||||
|
||||
QLIST_ENTRY(BdrvChild) next;
|
||||
QLIST_ENTRY(BdrvChild GRAPH_RDLOCK_PTR) next;
|
||||
QLIST_ENTRY(BdrvChild GRAPH_RDLOCK_PTR) next_parent;
|
||||
};
|
||||
|
||||
|
@ -1176,7 +1176,7 @@ struct BlockDriverState {
|
|||
* See also comment in include/block/block.h, to learn how backing and file
|
||||
* are connected with BdrvChildRole.
|
||||
*/
|
||||
QLIST_HEAD(, BdrvChild) children;
|
||||
QLIST_HEAD(, BdrvChild GRAPH_RDLOCK_PTR) children;
|
||||
BdrvChild *backing;
|
||||
BdrvChild *file;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue