diff options
author | Kevin Wolf <kwolf@redhat.com> | 2018-04-23 12:24:16 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-05-23 14:30:50 +0200 |
commit | 3453d97243c72988c89a0105fa9546890eae7bd4 (patch) | |
tree | b1319fc9423528d2bcb84e8378e877f25e6bd248 /block/mirror.c | |
parent | b69f777dd9ba992fdd35828a90eefcd88c0ec332 (diff) | |
download | qemu-3453d97243c72988c89a0105fa9546890eae7bd4.zip |
job: Move .complete callback to Job
This moves the .complete callback that tells a READY job to complete
from BlockJobDriver to JobDriver. The wrapper function job_complete()
doesn't require anything block job specific any more and can be moved
to Job.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/mirror.c')
-rw-r--r-- | block/mirror.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/block/mirror.c b/block/mirror.c index a579bd8cd1..656237af5c 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -905,16 +905,16 @@ immediate_exit: job_defer_to_main_loop(&s->common.job, mirror_exit, data); } -static void mirror_complete(BlockJob *job, Error **errp) +static void mirror_complete(Job *job, Error **errp) { - MirrorBlockJob *s = container_of(job, MirrorBlockJob, common); + MirrorBlockJob *s = container_of(job, MirrorBlockJob, common.job); BlockDriverState *target; target = blk_bs(s->target); if (!s->synced) { error_setg(errp, "The active block job '%s' cannot be completed", - job->job.id); + job->id); return; } @@ -995,8 +995,8 @@ static const BlockJobDriver mirror_job_driver = { .drain = block_job_drain, .start = mirror_run, .pause = mirror_pause, + .complete = mirror_complete, }, - .complete = mirror_complete, .attached_aio_context = mirror_attached_aio_context, .drain = mirror_drain, }; @@ -1010,8 +1010,8 @@ static const BlockJobDriver commit_active_job_driver = { .drain = block_job_drain, .start = mirror_run, .pause = mirror_pause, + .complete = mirror_complete, }, - .complete = mirror_complete, .attached_aio_context = mirror_attached_aio_context, .drain = mirror_drain, }; |