aboutsummaryrefslogtreecommitdiff
path: root/include/qemu/job.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/qemu/job.h')
-rw-r--r--include/qemu/job.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/qemu/job.h b/include/qemu/job.h
index 2648c74..aebc195 100644
--- a/include/qemu/job.h
+++ b/include/qemu/job.h
@@ -167,6 +167,13 @@ struct JobDriver {
*/
void (*user_resume)(Job *job);
+ /*
+ * 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
+ * as required to ensure progress.
+ */
+ void (*drain)(Job *job);
+
/**
* If the callback is not NULL, it will be invoked when all the jobs
* belonging to the same transaction complete; or upon this job's
@@ -325,6 +332,12 @@ bool job_user_paused(Job *job);
*/
void job_user_resume(Job *job, Error **errp);
+/*
+ * Drain any activities as required to ensure progress. This can be called in a
+ * loop to synchronously complete a job.
+ */
+void job_drain(Job *job);
+
/**
* Get the next element from the list of block jobs after @job, or the
* first one if @job is %NULL.