提交 7b770c72 编写于 作者: S Stefan Hajnoczi

mirror: fix early wake from sleep due to aio

The mirror blockjob coroutine rate-limits itself by sleeping.  The
coroutine also performs I/O asynchronously so it's important that the
aio callback doesn't wake the coroutine early as that breaks
rate-limiting.
Reported-by: NJoaquim Barrera <jbarrera@ac.upc.edu>
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 cc8c9d6c
...@@ -98,7 +98,14 @@ static void mirror_iteration_done(MirrorOp *op, int ret) ...@@ -98,7 +98,14 @@ static void mirror_iteration_done(MirrorOp *op, int ret)
qemu_iovec_destroy(&op->qiov); qemu_iovec_destroy(&op->qiov);
g_slice_free(MirrorOp, op); g_slice_free(MirrorOp, op);
qemu_coroutine_enter(s->common.co, NULL);
/* Enter coroutine when it is not sleeping. The coroutine sleeps to
* rate-limit itself. The coroutine will eventually resume since there is
* a sleep timeout so don't wake it early.
*/
if (s->common.busy) {
qemu_coroutine_enter(s->common.co, NULL);
}
} }
static void mirror_write_complete(void *opaque, int ret) static void mirror_write_complete(void *opaque, int ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册