aboutsummaryrefslogtreecommitdiff
path: root/block/vmdk.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2023-10-27 17:53:26 +0200
committerKevin Wolf <kwolf@redhat.com>2023-11-08 17:56:17 +0100
commit004915a96a7a40e942ac85e6d22518cbcd283506 (patch)
treef664b5576e09107b86228b8b6fa340f74c907677 /block/vmdk.c
parentccd6a37947574707613e826e2bf04d55f1d5f238 (diff)
downloadqemu-004915a96a7a40e942ac85e6d22518cbcd283506.zip
qemu-004915a96a7a40e942ac85e6d22518cbcd283506.tar.gz
qemu-004915a96a7a40e942ac85e6d22518cbcd283506.tar.bz2
block: Protect bs->backing with graph_lock
Almost all functions that access bs->backing 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: <20231027155333.420094-18-kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/vmdk.c')
-rw-r--r--block/vmdk.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/vmdk.c b/block/vmdk.c
index 91ed7a8..5c789bb 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -380,7 +380,7 @@ out:
return ret;
}
-static int coroutine_fn vmdk_is_cid_valid(BlockDriverState *bs)
+static int coroutine_fn GRAPH_RDLOCK vmdk_is_cid_valid(BlockDriverState *bs)
{
BDRVVmdkState *s = bs->opaque;
uint32_t cur_pcid;
@@ -3044,8 +3044,9 @@ vmdk_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
return 0;
}
-static void vmdk_gather_child_options(BlockDriverState *bs, QDict *target,
- bool backing_overridden)
+static void GRAPH_RDLOCK
+vmdk_gather_child_options(BlockDriverState *bs, QDict *target,
+ bool backing_overridden)
{
/* No children but file and backing can be explicitly specified (TODO) */
qdict_put(target, "file",