mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
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>
This commit is contained in:
parent
daa7f2f946
commit
08be6fe26f
3 changed files with 13 additions and 3 deletions
4
job.c
4
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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue