diff options
| author | Kevin Wolf <kwolf@redhat.com> | 2023-09-29 16:51:56 +0200 |
|---|---|---|
| committer | Kevin Wolf <kwolf@redhat.com> | 2023-10-12 16:31:33 +0200 |
| commit | 680e0cc40c5830ebcbfa0bce99bf932e1a4cf6c6 (patch) | |
| tree | 25d4599f69d96706708243a273e1a4f37124075e /block.c | |
| parent | b59b466071391cb76b39584e1558be2d0797c054 (diff) | |
| download | focaccia-qemu-680e0cc40c5830ebcbfa0bce99bf932e1a4cf6c6.tar.gz focaccia-qemu-680e0cc40c5830ebcbfa0bce99bf932e1a4cf6c6.zip | |
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>
Diffstat (limited to 'block.c')
| -rw-r--r-- | block.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block.c b/block.c index 2ac7406c77..f9cf05ddcf 100644 --- a/block.c +++ b/block.c @@ -2973,6 +2973,8 @@ static void bdrv_child_free(BdrvChild *child) { assert(!child->bs); GLOBAL_STATE_CODE(); + GRAPH_RDLOCK_GUARD_MAINLOOP(); + assert(!child->next.le_prev); /* not in children list */ g_free(child->name); |