summary refs log tree commit diff stats
path: root/qemu-img.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2023-05-04 13:57:48 +0200
committerKevin Wolf <kwolf@redhat.com>2023-05-10 14:16:54 +0200
commit4f0bef8b36eb33efbba0a216b233265d734bdbfb (patch)
treeb995bdf9d339ce44b3246a06f24793c84baae3d4 /qemu-img.c
parent6ec75a6a3ed9d6ff3161d1f97c497909906495bd (diff)
downloadfocaccia-qemu-4f0bef8b36eb33efbba0a216b233265d734bdbfb.tar.gz
focaccia-qemu-4f0bef8b36eb33efbba0a216b233265d734bdbfb.zip
block: Mark bdrv_query_block_graph_info() and callers GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_query_block_graph_info() need to hold a reader lock for the graph
because it accesses the children list of a node.

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-19-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 9aeac69fa6..9f9f0a7629 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2938,6 +2938,8 @@ static BlockGraphInfoList *collect_image_info_list(bool image_opts,
         }
         bs = blk_bs(blk);
 
+        GRAPH_RDLOCK_GUARD_MAINLOOP();
+
         /*
          * Note that the returned BlockGraphInfo object will not have
          * information about this image's backing node, because we have opened