diff options
author | Fam Zheng | 2017-04-10 14:16:18 +0200 |
---|---|---|
committer | Fam Zheng | 2017-04-11 14:07:15 +0200 |
commit | 324ec3e4f26e0a2a422478db4b9992f8aad3bde4 (patch) | |
tree | d5afe9c6606b3f8dca60b28a61f51d3cafa1ee6e | |
parent | blockjob: Use bdrv_coroutine_enter to start coroutine (diff) | |
download | qemu-324ec3e4f26e0a2a422478db4b9992f8aad3bde4.tar.gz qemu-324ec3e4f26e0a2a422478db4b9992f8aad3bde4.tar.xz 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.c | 2 |
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); } |