Lines Matching refs:bs
43 BlockDriverState *bs = opaque; in sleep_in_drain_begin() local
46 bdrv_dec_in_flight(bs); in sleep_in_drain_begin()
49 static void bdrv_test_drain_begin(BlockDriverState *bs) in bdrv_test_drain_begin() argument
51 BDRVTestState *s = bs->opaque; in bdrv_test_drain_begin()
54 Coroutine *co = qemu_coroutine_create(sleep_in_drain_begin, bs); in bdrv_test_drain_begin()
55 bdrv_inc_in_flight(bs); in bdrv_test_drain_begin()
56 aio_co_enter(bdrv_get_aio_context(bs), co); in bdrv_test_drain_begin()
60 static void bdrv_test_drain_end(BlockDriverState *bs) in bdrv_test_drain_end() argument
62 BDRVTestState *s = bs->opaque; in bdrv_test_drain_end()
66 static void bdrv_test_close(BlockDriverState *bs) in bdrv_test_close() argument
68 BDRVTestState *s = bs->opaque; in bdrv_test_close()
77 static int coroutine_fn bdrv_test_co_preadv(BlockDriverState *bs, in bdrv_test_co_preadv() argument
82 BDRVTestState *s = bs->opaque; in bdrv_test_co_preadv()
99 static int bdrv_test_co_change_backing_file(BlockDriverState *bs, in bdrv_test_co_change_backing_file() argument
162 static void do_drain_begin(enum drain_type drain_type, BlockDriverState *bs) in do_drain_begin() argument
166 case BDRV_DRAIN: bdrv_drained_begin(bs); break; in do_drain_begin()
171 static void do_drain_end(enum drain_type drain_type, BlockDriverState *bs) in do_drain_end() argument
175 case BDRV_DRAIN: bdrv_drained_end(bs); break; in do_drain_end()
180 static void do_drain_begin_unlocked(enum drain_type drain_type, BlockDriverState *bs) in do_drain_begin_unlocked() argument
182 do_drain_begin(drain_type, bs); in do_drain_begin_unlocked()
188 BlockDriverState *bs, *backing; in test_setup() local
191 bs = bdrv_new_open_driver(&bdrv_test, "test-node", BDRV_O_RDWR, in test_setup()
193 blk_insert_bs(blk, bs, &error_abort); in test_setup()
196 bdrv_set_backing_hd(bs, backing, &error_abort); in test_setup()
199 bdrv_unref(bs); in test_setup()
204 static void do_drain_end_unlocked(enum drain_type drain_type, BlockDriverState *bs) in do_drain_end_unlocked() argument
206 do_drain_end(drain_type, bs); in do_drain_end_unlocked()
218 BlockDriverState *bs = blk_bs(blk); in test_drv_cb_common() local
219 BlockDriverState *backing = bs->backing->bs; in test_drv_cb_common()
226 s = bs->opaque; in test_drv_cb_common()
233 do_drain_begin(drain_type, bs); in test_drv_cb_common()
238 do_drain_end(drain_type, bs); in test_drv_cb_common()
252 do_drain_begin(drain_type, bs); in test_drv_cb_common()
258 do_drain_end(drain_type, bs); in test_drv_cb_common()
313 BlockDriverState *bs = blk_bs(blk); in test_quiesce_common() local
314 BlockDriverState *backing = bs->backing->bs; in test_quiesce_common()
316 g_assert_cmpint(bs->quiesce_counter, ==, 0); in test_quiesce_common()
319 do_drain_begin(drain_type, bs); in test_quiesce_common()
322 g_assert_cmpint(bs->quiesce_counter, ==, 2); in test_quiesce_common()
324 g_assert_cmpint(bs->quiesce_counter, ==, 1); in test_quiesce_common()
328 do_drain_end(drain_type, bs); in test_quiesce_common()
330 g_assert_cmpint(bs->quiesce_counter, ==, 0); in test_quiesce_common()
377 BlockDriverState *bs, *backing; in test_nested() local
382 bs = bdrv_new_open_driver(&bdrv_test, "test-node", BDRV_O_RDWR, in test_nested()
384 s = bs->opaque; in test_nested()
385 blk_insert_bs(blk, bs, &error_abort); in test_nested()
389 bdrv_set_backing_hd(bs, backing, &error_abort); in test_nested()
396 g_assert_cmpint(bs->quiesce_counter, ==, 0); in test_nested()
401 do_drain_begin(outer, bs); in test_nested()
402 do_drain_begin(inner, bs); in test_nested()
404 g_assert_cmpint(bs->quiesce_counter, ==, 2 + !!backing_quiesce); in test_nested()
409 do_drain_end(inner, bs); in test_nested()
410 do_drain_end(outer, bs); in test_nested()
412 g_assert_cmpint(bs->quiesce_counter, ==, 0); in test_nested()
420 bdrv_unref(bs); in test_nested()
482 BlockDriverState *bs; member
492 do_drain_begin(data->drain_type, data->bs); in test_iothread_drain_co_entry()
494 do_drain_end(data->drain_type, data->bs); in test_iothread_drain_co_entry()
511 bdrv_flush(data->bs); in test_iothread_main_thread_bh()
512 bdrv_dec_in_flight(data->bs); /* incremented by test_iothread_common() */ in test_iothread_main_thread_bh()
527 BlockDriverState *bs; in test_iothread_common() local
547 bs = bdrv_new_open_driver(&bdrv_test, "test-node", BDRV_O_RDWR, in test_iothread_common()
549 s = bs->opaque; in test_iothread_common()
550 blk_insert_bs(blk, bs, &error_abort); in test_iothread_common()
569 .bs = bs, in test_iothread_common()
582 bdrv_inc_in_flight(bs); in test_iothread_common()
590 do_drain_begin(drain_type, bs); in test_iothread_common()
591 g_assert_cmpint(bs->in_flight, ==, 0); in test_iothread_common()
596 do_drain_end(drain_type, bs); in test_iothread_common()
609 bdrv_unref(bs); in test_iothread_common()
632 BlockDriverState *bs; member
644 bdrv_flush(s->bs); in test_job_prepare()
653 bdrv_flush(s->bs); in test_job_commit()
661 bdrv_flush(s->bs); in test_job_abort()
770 tjob->bs = src; in test_blockjob_common_drain_node()
950 static void bdrv_test_top_close(BlockDriverState *bs) in bdrv_test_top_close() argument
955 QLIST_FOREACH_SAFE(c, &bs->children, next, next_c) { in bdrv_test_top_close()
956 bdrv_unref_child(bs, c); in bdrv_test_top_close()
962 bdrv_test_top_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, in bdrv_test_top_co_preadv() argument
965 BDRVTestTopState *tts = bs->opaque; in bdrv_test_top_co_preadv()
989 BlockDriverState *bs = blk_bs(blk); in test_co_delete_by_drain() local
990 BDRVTestTopState *tts = bs->opaque; in test_co_delete_by_drain()
1006 g_assert_cmpint(bs->refcnt, ==, 1); in test_co_delete_by_drain()
1013 QLIST_FOREACH_SAFE(c, &bs->children, next, next_c) { in test_co_delete_by_drain()
1015 bdrv_co_unref_child(bs, c); in test_co_delete_by_drain()
1036 BlockDriverState *bs, *child_bs, *null_bs; in do_test_delete_by_drain() local
1041 bs = bdrv_new_open_driver(&bdrv_test_top_driver, "top", BDRV_O_RDWR, in do_test_delete_by_drain()
1043 bs->total_sectors = 65536 >> BDRV_SECTOR_BITS; in do_test_delete_by_drain()
1044 tts = bs->opaque; in do_test_delete_by_drain()
1049 bdrv_attach_child(bs, null_bs, "null-child", &child_of_bds, in do_test_delete_by_drain()
1060 tts->wait_child = bdrv_attach_child(bs, child_bs, "wait-child", in do_test_delete_by_drain()
1071 bdrv_attach_child(bs, null_bs, "null-child", &child_of_bds, BDRV_CHILD_DATA, in do_test_delete_by_drain()
1076 blk_insert_bs(blk, bs, &error_abort); in do_test_delete_by_drain()
1079 bdrv_unref(bs); in do_test_delete_by_drain()
1081 g_assert_cmpint(bs->refcnt, ==, 1); in do_test_delete_by_drain()
1154 bdrv_dec_in_flight(data->child_b->bs); in detach_indirect_bh()
1172 bdrv_inc_in_flight(data->child_b->bs); in detach_by_parent_aio_cb()
1187 bdrv_inc_in_flight(data->child_b->bs); in detach_by_driver_cb_drained_begin()
1388 BlockDriverState *bs; in test_set_aio_context() local
1394 bs = bdrv_new_open_driver(&bdrv_test, "test-node", BDRV_O_RDWR, in test_set_aio_context()
1397 bdrv_drained_begin(bs); in test_set_aio_context()
1398 bdrv_try_change_aio_context(bs, ctx_a, NULL, &error_abort); in test_set_aio_context()
1399 bdrv_drained_end(bs); in test_set_aio_context()
1401 bdrv_drained_begin(bs); in test_set_aio_context()
1402 bdrv_try_change_aio_context(bs, ctx_b, NULL, &error_abort); in test_set_aio_context()
1403 bdrv_try_change_aio_context(bs, qemu_get_aio_context(), NULL, &error_abort); in test_set_aio_context()
1404 bdrv_drained_end(bs); in test_set_aio_context()
1406 bdrv_unref(bs); in test_set_aio_context()
1417 BlockDriverState *bs; member
1437 bdrv_set_backing_hd(s->bs, NULL, &error_abort); in test_drop_backing_job_commit()
1537 job->bs = bs_parents[2]; in test_blockjob_commit_by_drained_end()
1728 static void bdrv_replace_test_close(BlockDriverState *bs) in bdrv_replace_test_close() argument
1743 bdrv_replace_test_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, in bdrv_replace_test_co_preadv() argument
1746 BDRVReplaceTestState *s = bs->opaque; in bdrv_replace_test_co_preadv()
1748 if (bs->backing) { in bdrv_replace_test_co_preadv()
1760 ret = bdrv_co_preadv(bs->backing, offset, bytes, qiov, 0); in bdrv_replace_test_co_preadv()
1777 BlockDriverState *bs = opaque; in bdrv_replace_test_drain_co() local
1778 BDRVReplaceTestState *s = bs->opaque; in bdrv_replace_test_drain_co()
1787 bdrv_dec_in_flight(bs); in bdrv_replace_test_drain_co()
1795 static void bdrv_replace_test_drain_begin(BlockDriverState *bs) in bdrv_replace_test_drain_begin() argument
1797 BDRVReplaceTestState *s = bs->opaque; in bdrv_replace_test_drain_begin()
1804 s->drain_co = qemu_coroutine_create(bdrv_replace_test_drain_co, bs); in bdrv_replace_test_drain_begin()
1805 bdrv_inc_in_flight(bs); in bdrv_replace_test_drain_begin()
1806 aio_co_enter(bdrv_get_aio_context(bs), s->drain_co); in bdrv_replace_test_drain_begin()
1814 BlockDriverState *bs = opaque; in bdrv_replace_test_read_entry() local
1821 ret = bdrv_replace_test_co_preadv(bs, 0, 1, &qiov, 0); in bdrv_replace_test_read_entry()
1825 bdrv_dec_in_flight(bs); in bdrv_replace_test_read_entry()
1833 static void bdrv_replace_test_drain_end(BlockDriverState *bs) in bdrv_replace_test_drain_end() argument
1835 BDRVReplaceTestState *s = bs->opaque; in bdrv_replace_test_drain_end()
1847 if (bs->backing) { in bdrv_replace_test_drain_end()
1849 bs); in bdrv_replace_test_drain_end()
1850 bdrv_inc_in_flight(bs); in bdrv_replace_test_drain_end()
1851 aio_co_enter(bdrv_get_aio_context(bs), co); in bdrv_replace_test_drain_end()