]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
block/stream: mark stream_prepare() as GRAPH_UNLOCKED
authorFiona Ebner <f.ebner@proxmox.com>
Fri, 30 May 2025 15:11:10 +0000 (17:11 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 14 Jul 2025 13:42:04 +0000 (15:42 +0200)
The function stream_prepare() calls bdrv_drain_all_begin(), which
must be called with the graph unlocked.

Also mark the JobDriver's prepare() callback as GRAPH_UNLOCKED_PTR,
because that is the callback via which stream_prepare() is reached.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Message-ID: <20250530151125.955508-34-f.ebner@proxmox.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/stream.c
include/qemu/job.h

index 17e240460c1b02cf6f370b616323459d7dc850ac..c0616b69e259bf5a9b146dadd9dbac62bfaa9f23 100644 (file)
@@ -51,7 +51,7 @@ static int coroutine_fn stream_populate(BlockBackend *blk,
     return blk_co_preadv(blk, offset, bytes, NULL, BDRV_REQ_PREFETCH);
 }
 
-static int stream_prepare(Job *job)
+static int GRAPH_UNLOCKED stream_prepare(Job *job)
 {
     StreamBlockJob *s = container_of(job, StreamBlockJob, common.job);
     BlockDriverState *unfiltered_bs;
index a5a04155ea5e4eb592692131f196bd07fb7abeea..bb8ee766efd32167dc698759e3aebb2593b3a376 100644 (file)
@@ -263,7 +263,7 @@ struct JobDriver {
      * This callback will not be invoked if the job has already failed.
      * If it fails, abort and then clean will be called.
      */
-    int (*prepare)(Job *job);
+    int GRAPH_UNLOCKED_PTR (*prepare)(Job *job);
 
     /**
      * If the callback is not NULL, it will be invoked when all the jobs