提交 cee3c6b5 编写于 作者: A Alberto Garcia 提交者: Kevin Wolf

block: Use block_job_add_bdrv() in mirror_start_job()

Use block_job_add_bdrv() instead of blocking all operations in
mirror_start_job() and unblocking them in mirror_exit().
Signed-off-by: NAlberto Garcia <berto@igalia.com>
Reviewed-by: NKevin Wolf <kwolf@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 23d402d4
......@@ -530,7 +530,6 @@ static void mirror_exit(BlockJob *job, void *opaque)
aio_context_release(replace_aio_context);
}
g_free(s->replaces);
bdrv_op_unblock_all(target_bs, s->common.blocker);
blk_unref(s->target);
s->target = NULL;
block_job_completed(&s->common, data->ret);
......@@ -997,7 +996,7 @@ static void mirror_start_job(const char *job_id, BlockDriverState *bs,
return;
}
bdrv_op_block_all(target, s->common.blocker);
block_job_add_bdrv(&s->common, target);
s->common.co = qemu_coroutine_create(mirror_run, s);
trace_mirror_start(bs, s, s->common.co, opaque);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册