mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user