aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-04-17 13:49:33 +0200
committerKevin Wolf <kwolf@redhat.com>2018-05-23 14:30:49 +0200
commit08be6fe26f6c76d900fc987f58d322b94bc4e248 (patch)
treebd98a75c6e330ba806ea7517509e9c166f0be5fa /include
parentdaa7f2f9467bc5624f04f28d4b01b88f08c6589c (diff)
job: Add Job.aio_context
When block jobs need an AioContext, they just take it from their main block node. Generic jobs don't have a main block node, so we need to assign them an AioContext explicitly. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/qemu/job.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/qemu/job.h b/include/qemu/job.h
index 5dfbec5d69..01e083f97a 100644
--- a/include/qemu/job.h
+++ b/include/qemu/job.h
@@ -47,6 +47,9 @@ typedef struct Job {
/** Current state; See @JobStatus for details. */
JobStatus status;
+ /** AioContext to run the job coroutine in */
+ AioContext *aio_context;
+
/**
* Set to true if the job should cancel itself. The flag must
* always be tested just before toggling the busy flag from false
@@ -79,9 +82,11 @@ struct JobDriver {
*
* @job_id: The id of the newly-created job, or %NULL for internal jobs
* @driver: The class object for the newly-created job.
+ * @ctx: The AioContext to run the job coroutine in.
* @errp: Error object.
*/
-void *job_create(const char *job_id, const JobDriver *driver, Error **errp);
+void *job_create(const char *job_id, const JobDriver *driver, AioContext *ctx,
+ Error **errp);
/**
* Add a reference to Job refcnt, it will be decreased with job_unref, and then