diff mbox series

[15/17] mirror: Release AioCtx before queue_restart_all()

Message ID 20180813022006.7216-16-mreitz@redhat.com (mailing list archive)
State New, archived
Headers show
Series mirror: Mainly coroutine refinements | expand

Commit Message

Max Reitz Aug. 13, 2018, 2:20 a.m. UTC
Calling qemu_co_queue_restart_all() with a held AioContext looks a bit
strange.  There is no reason why we would hold the context any longer
(as this coroutine is not going to perform any further operations that
would necessitate it), so release it before restarting the waiting
requests.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/mirror.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/block/mirror.c b/block/mirror.c
index 053c37b6a6..cba7de610e 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -395,10 +395,10 @@  static void coroutine_fn mirror_co_perform(void *opaque)
         }
     }
 
+    aio_context_release(aio_context);
+
     qemu_co_queue_restart_all(&op->waiting_requests);
     g_free(op);
-
-    aio_context_release(aio_context);
 }
 
 /* If mirror_method == MIRROR_METHOD_COPY, *offset and *bytes will be