summaryrefslogtreecommitdiffstats
path: root/include/qemu
diff options
context:
space:
mode:
authorKevin Wolf2018-04-23 12:24:16 +0200
committerKevin Wolf2018-05-23 14:30:50 +0200
commit3453d97243c72988c89a0105fa9546890eae7bd4 (patch)
treeb1319fc9423528d2bcb84e8378e877f25e6bd248 /include/qemu
parentjob: Add job_drain() (diff)
downloadqemu-3453d97243c72988c89a0105fa9546890eae7bd4.tar.gz
qemu-3453d97243c72988c89a0105fa9546890eae7bd4.tar.xz
qemu-3453d97243c72988c89a0105fa9546890eae7bd4.zip
job: Move .complete callback to Job
This moves the .complete callback that tells a READY job to complete from BlockJobDriver to JobDriver. The wrapper function job_complete() doesn't require anything block job specific any more and can be moved to Job. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/job.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/qemu/job.h b/include/qemu/job.h
index aebc1959e6..8f7f71a9b1 100644
--- a/include/qemu/job.h
+++ b/include/qemu/job.h
@@ -167,6 +167,12 @@ struct JobDriver {
*/
void (*user_resume)(Job *job);
+ /**
+ * Optional callback for job types whose completion must be triggered
+ * manually.
+ */
+ void (*complete)(Job *job, Error **errp);
+
/*
* If the callback is not NULL, it will be invoked when the job has to be
* synchronously cancelled or completed; it should drain any activities
@@ -363,6 +369,8 @@ int job_apply_verb(Job *job, JobVerb verb, Error **errp);
/** The @job could not be started, free it. */
void job_early_fail(Job *job);
+/** Asynchronously complete the specified @job. */
+void job_complete(Job *job, Error **errp);;
typedef void JobDeferToMainLoopFn(Job *job, void *opaque);