diff options
author | John Snow <jsnow@redhat.com> | 2016-11-08 01:50:37 -0500 |
---|---|---|
committer | Jeff Cody <jcody@redhat.com> | 2016-11-14 22:47:34 -0500 |
commit | 5ccac6f186e4a480074880d958760c7105cf9ba8 (patch) | |
tree | 7f5f66df425b35ad18683743788ad575032cbeea /block/commit.c | |
parent | a7815a764c40c9dcf204f666c2d90248095376a8 (diff) |
blockjob: add block_job_start
Instead of automatically starting jobs at creation time via backup_start
et al, we'd like to return a job object pointer that can be started
manually at later point in time.
For now, add the block_job_start mechanism and start the jobs
automatically as we have been doing, with conversions job-by-job coming
in later patches.
Of note: cancellation of unstarted jobs will perform all the normal
cleanup as if the job had started, particularly abort and clean. The
only difference is that we will not emit any events, because the job
never actually started.
Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1478587839-9834-5-git-send-email-jsnow@redhat.com
Signed-off-by: Jeff Cody <jcody@redhat.com>
Diffstat (limited to 'block/commit.c')
-rw-r--r-- | block/commit.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/block/commit.c b/block/commit.c index 20d27e27a8..c284e8535d 100644 --- a/block/commit.c +++ b/block/commit.c @@ -289,10 +289,9 @@ void commit_start(const char *job_id, BlockDriverState *bs, s->backing_file_str = g_strdup(backing_file_str); s->on_error = on_error; - s->common.co = qemu_coroutine_create(s->common.driver->start, s); - trace_commit_start(bs, base, top, s, s->common.co); - qemu_coroutine_enter(s->common.co); + trace_commit_start(bs, base, top, s); + block_job_start(&s->common); } |