qemu-block
[Top][All Lists]
Advanced

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

[Qemu-block] [PATCH 08/11] block: drain I/O around key management


From: Paolo Bonzini
Subject: [Qemu-block] [PATCH 08/11] block: drain I/O around key management
Date: Thu, 6 Jul 2017 18:38:25 +0200

The resulting drained section is a replacement for the AioContext.

Signed-off-by: Paolo Bonzini <address@hidden>
---
 blockdev.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index f92dcf24bf..b2c305402d 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2253,7 +2253,6 @@ void qmp_block_passwd(bool has_device, const char *device,
 {
     Error *local_err = NULL;
     BlockDriverState *bs;
-    AioContext *aio_context;
 
     bs = bdrv_lookup_bs(has_device ? device : NULL,
                         has_node_name ? node_name : NULL,
@@ -2263,12 +2262,9 @@ void qmp_block_passwd(bool has_device, const char 
*device,
         return;
     }
 
-    aio_context = bdrv_get_aio_context(bs);
-    aio_context_acquire(aio_context);
-
+    bdrv_drained_begin(bs);
     bdrv_add_key(bs, password, errp);
-
-    aio_context_release(aio_context);
+    bdrv_drained_end(bs);
 }
 
 /*
-- 
2.13.0





reply via email to

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