aboutsummaryrefslogtreecommitdiff
path: root/job.c
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 /job.c
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 'job.c')
-rw-r--r--job.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/job.c b/job.c
index 1abca6a2fc..01074d0fae 100644
--- a/job.c
+++ b/job.c
@@ -121,7 +121,8 @@ Job *job_get(const char *id)
return NULL;
}
-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)
{
Job *job;
@@ -140,6 +141,7 @@ void *job_create(const char *job_id, const JobDriver *driver, Error **errp)
job->driver = driver;
job->id = g_strdup(job_id);
job->refcnt = 1;
+ job->aio_context = ctx;
job_state_transition(job, JOB_STATUS_CREATED);