aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-04-23 16:06:26 +0200
committerKevin Wolf <kwolf@redhat.com>2018-05-23 14:30:51 +0200
commit7eaa8fb57da96301f4a8ce176ad503f80efc7cc0 (patch)
tree2450798efd3aa3104933bceeb7d44dfe1d8edf51 /tests
parent62c9e4162a7bc26a1389e50d17d3b2637028bbc3 (diff)
downloadqemu-7eaa8fb57da96301f4a8ce176ad503f80efc7cc0.zip
qemu-7eaa8fb57da96301f4a8ce176ad503f80efc7cc0.tar.gz
qemu-7eaa8fb57da96301f4a8ce176ad503f80efc7cc0.tar.bz2
job: Move transactions to Job
This moves the logic that implements job transactions from BlockJob to Job. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test-blockjob-txn.c12
-rw-r--r--tests/test-blockjob.c2
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/test-blockjob-txn.c b/tests/test-blockjob-txn.c
index ec5d592..6ee31d5 100644
--- a/tests/test-blockjob-txn.c
+++ b/tests/test-blockjob-txn.c
@@ -125,7 +125,7 @@ static void test_single_job(int expected)
JobTxn *txn;
int result = -EINPROGRESS;
- txn = block_job_txn_new();
+ txn = job_txn_new();
job = test_block_job_start(1, true, expected, &result, txn);
job_start(&job->job);
@@ -138,7 +138,7 @@ static void test_single_job(int expected)
}
g_assert_cmpint(result, ==, expected);
- block_job_txn_unref(txn);
+ job_txn_unref(txn);
}
static void test_single_job_success(void)
@@ -164,7 +164,7 @@ static void test_pair_jobs(int expected1, int expected2)
int result1 = -EINPROGRESS;
int result2 = -EINPROGRESS;
- txn = block_job_txn_new();
+ txn = job_txn_new();
job1 = test_block_job_start(1, true, expected1, &result1, txn);
job2 = test_block_job_start(2, true, expected2, &result2, txn);
job_start(&job1->job);
@@ -173,7 +173,7 @@ static void test_pair_jobs(int expected1, int expected2)
/* Release our reference now to trigger as many nice
* use-after-free bugs as possible.
*/
- block_job_txn_unref(txn);
+ job_txn_unref(txn);
if (expected1 == -ECANCELED) {
block_job_cancel(job1, false);
@@ -226,7 +226,7 @@ static void test_pair_jobs_fail_cancel_race(void)
int result1 = -EINPROGRESS;
int result2 = -EINPROGRESS;
- txn = block_job_txn_new();
+ txn = job_txn_new();
job1 = test_block_job_start(1, true, -ECANCELED, &result1, txn);
job2 = test_block_job_start(2, false, 0, &result2, txn);
job_start(&job1->job);
@@ -247,7 +247,7 @@ static void test_pair_jobs_fail_cancel_race(void)
g_assert_cmpint(result1, ==, -ECANCELED);
g_assert_cmpint(result2, ==, -ECANCELED);
- block_job_txn_unref(txn);
+ job_txn_unref(txn);
}
int main(int argc, char **argv)
diff --git a/tests/test-blockjob.c b/tests/test-blockjob.c
index e44c608..1e052c2 100644
--- a/tests/test-blockjob.c
+++ b/tests/test-blockjob.c
@@ -364,7 +364,7 @@ static void test_cancel_concluded(void)
}
assert(job->job.status == JOB_STATUS_PENDING);
- block_job_finalize(job, &error_abort);
+ job_finalize(&job->job, &error_abort);
assert(job->job.status == JOB_STATUS_CONCLUDED);
cancel_common(s);