summary refs log tree commit diff stats
path: root/tests/unit/test-block-iothread.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2023-09-11 11:46:03 +0200
committerKevin Wolf <kwolf@redhat.com>2023-09-20 17:46:00 +0200
commit487b91870face8973e78d82cd312a77d8f9f5363 (patch)
treefb691b775b4b96633b38be17cdeff34595c404a7 /tests/unit/test-block-iothread.c
parentedcce17b1590d0e785d303d31a7b08182a1bdb1e (diff)
downloadfocaccia-qemu-487b91870face8973e78d82cd312a77d8f9f5363.tar.gz
focaccia-qemu-487b91870face8973e78d82cd312a77d8f9f5363.zip
block: Take AioContext lock for bdrv_append() more consistently
The documentation for bdrv_append() says that the caller must hold the
AioContext lock for bs_top. Change all callers to actually adhere to the
contract.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20230911094620.45040-5-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/unit/test-block-iothread.c')
-rw-r--r--tests/unit/test-block-iothread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/unit/test-block-iothread.c b/tests/unit/test-block-iothread.c
index d727a5fee8..9155547313 100644
--- a/tests/unit/test-block-iothread.c
+++ b/tests/unit/test-block-iothread.c
@@ -756,11 +756,14 @@ static void test_propagate_mirror(void)
                                   &error_abort);
 
     /* Start a mirror job */
+    aio_context_acquire(main_ctx);
     mirror_start("job0", src, target, NULL, JOB_DEFAULT, 0, 0, 0,
                  MIRROR_SYNC_MODE_NONE, MIRROR_OPEN_BACKING_CHAIN, false,
                  BLOCKDEV_ON_ERROR_REPORT, BLOCKDEV_ON_ERROR_REPORT,
                  false, "filter_node", MIRROR_COPY_MODE_BACKGROUND,
                  &error_abort);
+    aio_context_release(main_ctx);
+
     WITH_JOB_LOCK_GUARD() {
         job = job_get_locked("job0");
     }