aboutsummaryrefslogtreecommitdiff
path: root/tests/test-blockjob.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-04-23 12:24:16 +0200
committerKevin Wolf <kwolf@redhat.com>2018-05-23 14:30:50 +0200
commit3453d97243c72988c89a0105fa9546890eae7bd4 (patch)
treeb1319fc9423528d2bcb84e8378e877f25e6bd248 /tests/test-blockjob.c
parentb69f777dd9ba992fdd35828a90eefcd88c0ec332 (diff)
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 'tests/test-blockjob.c')
-rw-r--r--tests/test-blockjob.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test-blockjob.c b/tests/test-blockjob.c
index 592a13613d..e44c608327 100644
--- a/tests/test-blockjob.c
+++ b/tests/test-blockjob.c
@@ -171,9 +171,9 @@ static void cancel_job_completed(Job *job, void *opaque)
block_job_completed(bjob, 0);
}
-static void cancel_job_complete(BlockJob *job, Error **errp)
+static void cancel_job_complete(Job *job, Error **errp)
{
- CancelJob *s = container_of(job, CancelJob, common);
+ CancelJob *s = container_of(job, CancelJob, common.job);
s->should_complete = true;
}
@@ -204,8 +204,8 @@ static const BlockJobDriver test_cancel_driver = {
.user_resume = block_job_user_resume,
.drain = block_job_drain,
.start = cancel_job_start,
+ .complete = cancel_job_complete,
},
- .complete = cancel_job_complete,
};
static CancelJob *create_common(BlockJob **pjob)
@@ -333,7 +333,7 @@ static void test_cancel_pending(void)
block_job_enter(job);
assert(job->job.status == JOB_STATUS_READY);
- block_job_complete(job, &error_abort);
+ job_complete(&job->job, &error_abort);
block_job_enter(job);
while (!s->completed) {
aio_poll(qemu_get_aio_context(), true);
@@ -357,7 +357,7 @@ static void test_cancel_concluded(void)
block_job_enter(job);
assert(job->job.status == JOB_STATUS_READY);
- block_job_complete(job, &error_abort);
+ job_complete(&job->job, &error_abort);
block_job_enter(job);
while (!s->completed) {
aio_poll(qemu_get_aio_context(), true);