diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2021-05-06 17:13:56 +0300 |
---|---|---|
committer | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2021-12-28 15:18:56 +0100 |
commit | 1b177bbea0b8725e627eb18eb60b8866cd8e1df6 (patch) | |
tree | 4f925e6650d4dac056e2572729b9b8a94e783877 | |
parent | 048954e2f6d4e88383186db2d223f3a42ddb61f7 (diff) | |
download | qemu-1b177bbea0b8725e627eb18eb60b8866cd8e1df6.zip qemu-1b177bbea0b8725e627eb18eb60b8866cd8e1df6.tar.gz qemu-1b177bbea0b8725e627eb18eb60b8866cd8e1df6.tar.bz2 |
test-bdrv-drain: don't use BlockJob.blk
We are going to drop BlockJob.blk in further commit. For tests it's
enough to simply pass bs pointer.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Nikita Lapshin <nikita.lapshin@virtuozzo.com>
-rw-r--r-- | tests/unit/test-bdrv-drain.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/unit/test-bdrv-drain.c b/tests/unit/test-bdrv-drain.c index 2d3c17e..36be84a 100644 --- a/tests/unit/test-bdrv-drain.c +++ b/tests/unit/test-bdrv-drain.c @@ -772,6 +772,7 @@ static void test_iothread_drain_subtree(void) typedef struct TestBlockJob { BlockJob common; + BlockDriverState *bs; int run_ret; int prepare_ret; bool running; @@ -783,7 +784,7 @@ static int test_job_prepare(Job *job) TestBlockJob *s = container_of(job, TestBlockJob, common.job); /* Provoke an AIO_WAIT_WHILE() call to verify there is no deadlock */ - blk_flush(s->common.blk); + bdrv_flush(s->bs); return s->prepare_ret; } @@ -792,7 +793,7 @@ static void test_job_commit(Job *job) TestBlockJob *s = container_of(job, TestBlockJob, common.job); /* Provoke an AIO_WAIT_WHILE() call to verify there is no deadlock */ - blk_flush(s->common.blk); + bdrv_flush(s->bs); } static void test_job_abort(Job *job) @@ -800,7 +801,7 @@ static void test_job_abort(Job *job) TestBlockJob *s = container_of(job, TestBlockJob, common.job); /* Provoke an AIO_WAIT_WHILE() call to verify there is no deadlock */ - blk_flush(s->common.blk); + bdrv_flush(s->bs); } static int coroutine_fn test_job_run(Job *job, Error **errp) @@ -915,6 +916,7 @@ static void test_blockjob_common_drain_node(enum drain_type drain_type, tjob = block_job_create("job0", &test_job_driver, NULL, src, 0, BLK_PERM_ALL, 0, 0, NULL, NULL, &error_abort); + tjob->bs = src; job = &tjob->common; block_job_add_bdrv(job, "target", target, 0, BLK_PERM_ALL, &error_abort); @@ -1538,6 +1540,7 @@ typedef struct TestDropBackingBlockJob { bool should_complete; bool *did_complete; BlockDriverState *detach_also; + BlockDriverState *bs; } TestDropBackingBlockJob; static int coroutine_fn test_drop_backing_job_run(Job *job, Error **errp) @@ -1557,7 +1560,7 @@ static void test_drop_backing_job_commit(Job *job) TestDropBackingBlockJob *s = container_of(job, TestDropBackingBlockJob, common.job); - bdrv_set_backing_hd(blk_bs(s->common.blk), NULL, &error_abort); + bdrv_set_backing_hd(s->bs, NULL, &error_abort); bdrv_set_backing_hd(s->detach_also, NULL, &error_abort); *s->did_complete = true; @@ -1657,6 +1660,7 @@ static void test_blockjob_commit_by_drained_end(void) job = block_job_create("job", &test_drop_backing_job_driver, NULL, bs_parents[2], 0, BLK_PERM_ALL, 0, 0, NULL, NULL, &error_abort); + job->bs = bs_parents[2]; job->detach_also = bs_parents[0]; job->did_complete = &job_has_completed; |