summaryrefslogtreecommitdiff
path: root/block/mirror.c
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2016-10-28 10:08:05 +0300
committerKevin Wolf <kwolf@redhat.com>2016-10-31 16:52:38 +0100
commitcee3c6b5cab50a20cdb061ec107ec17bd2e54643 (patch)
tree4646320a8d3b3169c8096338c697e10d4148527a /block/mirror.c
parent23d402d42beb975b97303beb3d9d4f60f4a1a883 (diff)
downloadqemu-cee3c6b5cab50a20cdb061ec107ec17bd2e54643.tar.gz
qemu-cee3c6b5cab50a20cdb061ec107ec17bd2e54643.tar.bz2
qemu-cee3c6b5cab50a20cdb061ec107ec17bd2e54643.zip
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: Alberto Garcia <berto@igalia.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/mirror.c')
-rw-r--r--block/mirror.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/block/mirror.c b/block/mirror.c
index 3a0788ede3..04765ad2ff 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -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);