From 533c6e4ee8885cb9e7c6ac36e8e9fa92bea64f97 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 4 May 2023 13:57:49 +0200 Subject: block: Mark bdrv_recurse_can_replace() and callers GRAPH_RDLOCK This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_recurse_can_replace() need to hold a reader lock for the graph because it accesses the children list of a node. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Message-Id: <20230504115750.54437-20-kwolf@redhat.com> Signed-off-by: Kevin Wolf --- blockdev.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'blockdev.c') diff --git a/blockdev.c b/blockdev.c index e464dae..d141ca7 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2961,6 +2961,9 @@ static void blockdev_mirror_common(const char *job_id, BlockDriverState *bs, BlockDriverState *unfiltered_bs; int job_flags = JOB_DEFAULT; + GLOBAL_STATE_CODE(); + GRAPH_RDLOCK_GUARD_MAINLOOP(); + if (!has_speed) { speed = 0; } -- cgit v1.1