diff options
author | Kevin Wolf <kwolf@redhat.com> | 2018-04-17 13:49:33 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-05-23 14:30:49 +0200 |
commit | 08be6fe26f6c76d900fc987f58d322b94bc4e248 (patch) | |
tree | bd98a75c6e330ba806ea7517509e9c166f0be5fa /blockjob.c | |
parent | daa7f2f9467bc5624f04f28d4b01b88f08c6589c (diff) | |
download | qemu-08be6fe26f6c76d900fc987f58d322b94bc4e248.zip qemu-08be6fe26f6c76d900fc987f58d322b94bc4e248.tar.gz qemu-08be6fe26f6c76d900fc987f58d322b94bc4e248.tar.bz2 |
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 'blockjob.c')
-rw-r--r-- | blockjob.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -216,6 +216,7 @@ static void block_job_attached_aio_context(AioContext *new_context, { BlockJob *job = opaque; + job->job.aio_context = new_context; if (job->driver->attached_aio_context) { job->driver->attached_aio_context(job, new_context); } @@ -247,6 +248,7 @@ static void block_job_detach_aio_context(void *opaque) block_job_drain(job); } + job->job.aio_context = NULL; job_unref(&job->job); } @@ -899,7 +901,8 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver, return NULL; } - job = job_create(job_id, &driver->job_driver, errp); + job = job_create(job_id, &driver->job_driver, blk_get_aio_context(blk), + errp); if (job == NULL) { blk_unref(blk); return NULL; |