qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH RFC 6/9] block: Use aio_context_drained_begin in bdr


From: Fam Zheng
Subject: [Qemu-devel] [PATCH RFC 6/9] block: Use aio_context_drained_begin in bdrv_set_aio_context
Date: Wed, 29 Nov 2017 22:49:53 +0800

Signed-off-by: Fam Zheng <address@hidden>
---
 block.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/block.c b/block.c
index 9a1a0d1e73..949f0dec11 100644
--- a/block.c
+++ b/block.c
@@ -4745,8 +4745,7 @@ void bdrv_set_aio_context(BlockDriverState *bs, 
AioContext *new_context)
 {
     AioContext *ctx = bdrv_get_aio_context(bs);
 
-    aio_disable_external(ctx);
-    bdrv_parent_drained_begin(bs);
+    aio_context_drained_begin(ctx);
     bdrv_drain(bs); /* ensure there are no in-flight requests */
 
     while (aio_poll(ctx, false)) {
@@ -4760,8 +4759,7 @@ void bdrv_set_aio_context(BlockDriverState *bs, 
AioContext *new_context)
      */
     aio_context_acquire(new_context);
     bdrv_attach_aio_context(bs, new_context);
-    bdrv_parent_drained_end(bs);
-    aio_enable_external(ctx);
+    aio_context_drained_end(ctx);
     aio_context_release(new_context);
 }
 
-- 
2.14.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]