aboutsummaryrefslogtreecommitdiff
path: root/block/vhdx.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2023-05-04 13:57:41 +0200
committerKevin Wolf <kwolf@redhat.com>2023-05-10 14:16:53 +0200
commit622d30af9930e9eb791cf6344633c256e328a7ef (patch)
tree29fd314389c2717c73d0a73d8ea851a7c803270e /block/vhdx.c
parent69aa0d371f67b1c042ed4f3ff4a481d561b54d21 (diff)
downloadqemu-622d30af9930e9eb791cf6344633c256e328a7ef.zip
qemu-622d30af9930e9eb791cf6344633c256e328a7ef.tar.gz
qemu-622d30af9930e9eb791cf6344633c256e328a7ef.tar.bz2
vhdx: Require GRAPH_RDLOCK for accessing a node's parent list
This adds GRAPH_RDLOCK annotations to declare that functions accessing the parent list of a node need to hold a reader lock for the graph. As it happens, they already do. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20230504115750.54437-12-kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/vhdx.c')
-rw-r--r--block/vhdx.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/block/vhdx.c b/block/vhdx.c
index 00777da..b20b1ed 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -1506,8 +1506,9 @@ exit:
* There are 2 headers, and the highest sequence number will represent
* the active header
*/
-static int vhdx_create_new_headers(BlockBackend *blk, uint64_t image_size,
- uint32_t log_size)
+static int coroutine_fn GRAPH_RDLOCK
+vhdx_create_new_headers(BlockBackend *blk, uint64_t image_size,
+ uint32_t log_size)
{
BlockDriverState *bs = blk_bs(blk);
BdrvChild *child;
@@ -1897,8 +1898,8 @@ exit:
* .---- ~ ----------- ~ ------------ ~ ---------------- ~ -----------.
* 1MB
*/
-static int coroutine_fn vhdx_co_create(BlockdevCreateOptions *opts,
- Error **errp)
+static int coroutine_fn GRAPH_RDLOCK
+vhdx_co_create(BlockdevCreateOptions *opts, Error **errp)
{
BlockdevCreateOptionsVhdx *vhdx_opts;
BlockBackend *blk = NULL;