提交 324ec3e4 编写于 作者: F Fam Zheng

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: NFam Zheng <famz@redhat.com>
Acked-by: NStefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: NKevin Wolf <kwolf@redhat.com>
上级 aef4278c
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册