summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2017-04-10 20:16:18 +0800
committerFam Zheng <famz@redhat.com>2017-04-11 20:07:15 +0800
commit324ec3e4f26e0a2a422478db4b9992f8aad3bde4 (patch)
treed5afe9c6606b3f8dca60b28a61f51d3cafa1ee6e
parentaef4278c5a835c555ffe065f9e480190fd076675 (diff)
downloadfocaccia-qemu-324ec3e4f26e0a2a422478db4b9992f8aad3bde4.tar.gz
focaccia-qemu-324ec3e4f26e0a2a422478db4b9992f8aad3bde4.zip
qemu-io-cmds: Use bdrv_coroutine_enter
qemu_coroutine_create associates @co to qemu_aio_context but we poll
blk's context below. If the coroutine yields, it may never get resumed
again.

Use bdrv_coroutine_enter to make sure we are starting the I/O on the
right context.

Signed-off-by: Fam Zheng <famz@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--qemu-io-cmds.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index 883f53b64d..312fc6d157 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -521,7 +521,7 @@ static int do_co_pwrite_zeroes(BlockBackend *blk, int64_t offset,
     }
 
     co = qemu_coroutine_create(co_pwrite_zeroes_entry, &data);
-    qemu_coroutine_enter(co);
+    bdrv_coroutine_enter(blk_bs(blk), co);
     while (!data.done) {
         aio_poll(blk_get_aio_context(blk), true);
     }