]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block: Introduce bdrv_coroutine_enter
authorFam Zheng <famz@redhat.com>
Mon, 10 Apr 2017 12:09:25 +0000 (20:09 +0800)
committerFam Zheng <famz@redhat.com>
Tue, 11 Apr 2017 12:07:15 +0000 (20:07 +0800)
Signed-off-by: Fam Zheng <famz@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
block.c
include/block/block.h

diff --git a/block.c b/block.c
index a995a8ec00f6df675ee60820c7d9bd1042db5c2b..086a12df97115379d5d191509176455a13bd2c76 100644 (file)
--- a/block.c
+++ b/block.c
@@ -4324,6 +4324,11 @@ AioContext *bdrv_get_aio_context(BlockDriverState *bs)
     return bs->aio_context;
 }
 
+void bdrv_coroutine_enter(BlockDriverState *bs, Coroutine *co)
+{
+    aio_co_enter(bdrv_get_aio_context(bs), co);
+}
+
 static void bdrv_do_remove_aio_context_notifier(BdrvAioNotifier *ban)
 {
     QLIST_REMOVE(ban, list);
index 488a07ed671f4b18387b37f7397af48354f2eff8..97d4330292732b5ce965de7a167c8dc2e389bee0 100644 (file)
@@ -557,6 +557,11 @@ bool bdrv_debug_is_suspended(BlockDriverState *bs, const char *tag);
  */
 AioContext *bdrv_get_aio_context(BlockDriverState *bs);
 
+/**
+ * Transfer control to @co in the aio context of @bs
+ */
+void bdrv_coroutine_enter(BlockDriverState *bs, Coroutine *co);
+
 /**
  * bdrv_set_aio_context:
  *