aboutsummaryrefslogtreecommitdiff
path: root/include/qemu/job.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-04-20 15:33:57 +0200
committerKevin Wolf <kwolf@redhat.com>2018-05-23 14:30:50 +0200
commit6a74c075aca731e7e945201a4ae2336b8e328433 (patch)
tree29eb312c2f1d00edb488a495cb9942db21946fd6 /include/qemu/job.h
parent3453d97243c72988c89a0105fa9546890eae7bd4 (diff)
downloadqemu-6a74c075aca731e7e945201a4ae2336b8e328433.zip
qemu-6a74c075aca731e7e945201a4ae2336b8e328433.tar.gz
qemu-6a74c075aca731e7e945201a4ae2336b8e328433.tar.bz2
job: Move job_finish_sync() to Job
block_job_finish_sync() doesn't contain anything block job specific any more, so it 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/job.h')
-rw-r--r--include/qemu/job.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/qemu/job.h b/include/qemu/job.h
index 8f7f71a..17e2cec 100644
--- a/include/qemu/job.h
+++ b/include/qemu/job.h
@@ -389,6 +389,15 @@ typedef void JobDeferToMainLoopFn(Job *job, void *opaque);
*/
void job_defer_to_main_loop(Job *job, JobDeferToMainLoopFn *fn, void *opaque);
+/**
+ * Synchronously finishes the given @job. If @finish is given, it is called to
+ * trigger completion or cancellation of the job.
+ *
+ * Returns 0 if the job is successfully completed, -ECANCELED if the job was
+ * cancelled before completing, and -errno in other error cases.
+ */
+int job_finish_sync(Job *job, void (*finish)(Job *, Error **errp), Error **errp);
+
/* TODO To be removed from the public interface */
void job_state_transition(Job *job, JobStatus s1);
void coroutine_fn job_do_yield(Job *job, uint64_t ns);