aboutsummaryrefslogtreecommitdiff
path: root/block/commit.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-04-13 17:31:02 +0200
committerKevin Wolf <kwolf@redhat.com>2018-05-23 14:30:50 +0200
commitda01ff7f38f52791f93fc3ca59afcfbb220f15af (patch)
tree74010498c6229085ce3f2cc2184168aec5fb99f8 /block/commit.c
parent1908a5590c7d214b1b6886bc19b81076fb65cec9 (diff)
downloadqemu-da01ff7f38f52791f93fc3ca59afcfbb220f15af.zip
qemu-da01ff7f38f52791f93fc3ca59afcfbb220f15af.tar.gz
qemu-da01ff7f38f52791f93fc3ca59afcfbb220f15af.tar.bz2
job: Move coroutine and related code to Job
This commit moves some core functions for dealing with the job coroutine from BlockJob to Job. This includes primarily entering the coroutine (both for the first and reentering) and yielding explicitly and at pause points. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'block/commit.c')
-rw-r--r--block/commit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/commit.c b/block/commit.c
index d326766..2fbc310 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -220,8 +220,8 @@ static const BlockJobDriver commit_job_driver = {
.instance_size = sizeof(CommitBlockJob),
.job_type = JOB_TYPE_COMMIT,
.free = block_job_free,
+ .start = commit_run,
},
- .start = commit_run,
};
static int coroutine_fn bdrv_commit_top_preadv(BlockDriverState *bs,
@@ -371,7 +371,7 @@ void commit_start(const char *job_id, BlockDriverState *bs,
s->on_error = on_error;
trace_commit_start(bs, base, top, s);
- block_job_start(&s->common);
+ job_start(&s->common.job);
return;
fail: