Lines Matching refs:blk

114 static void test_sync_op_blk_pread(BlockBackend *blk)  in test_sync_op_blk_pread()  argument
120 ret = blk_pread(blk, 0, sizeof(buf), buf, 0); in test_sync_op_blk_pread()
124 ret = blk_pread(blk, -2, sizeof(buf), buf, 0); in test_sync_op_blk_pread()
128 static void test_sync_op_blk_pwrite(BlockBackend *blk) in test_sync_op_blk_pwrite() argument
134 ret = blk_pwrite(blk, 0, sizeof(buf), buf, 0); in test_sync_op_blk_pwrite()
138 ret = blk_pwrite(blk, -2, sizeof(buf), buf, 0); in test_sync_op_blk_pwrite()
142 static void test_sync_op_blk_preadv(BlockBackend *blk) in test_sync_op_blk_preadv() argument
149 ret = blk_preadv(blk, 0, sizeof(buf), &qiov, 0); in test_sync_op_blk_preadv()
153 ret = blk_preadv(blk, -2, sizeof(buf), &qiov, 0); in test_sync_op_blk_preadv()
157 static void test_sync_op_blk_pwritev(BlockBackend *blk) in test_sync_op_blk_pwritev() argument
164 ret = blk_pwritev(blk, 0, sizeof(buf), &qiov, 0); in test_sync_op_blk_pwritev()
168 ret = blk_pwritev(blk, -2, sizeof(buf), &qiov, 0); in test_sync_op_blk_pwritev()
172 static void test_sync_op_blk_preadv_part(BlockBackend *blk) in test_sync_op_blk_preadv_part() argument
179 ret = blk_preadv_part(blk, 0, sizeof(buf), &qiov, 0, 0); in test_sync_op_blk_preadv_part()
183 ret = blk_preadv_part(blk, -2, sizeof(buf), &qiov, 0, 0); in test_sync_op_blk_preadv_part()
187 static void test_sync_op_blk_pwritev_part(BlockBackend *blk) in test_sync_op_blk_pwritev_part() argument
194 ret = blk_pwritev_part(blk, 0, sizeof(buf), &qiov, 0, 0); in test_sync_op_blk_pwritev_part()
198 ret = blk_pwritev_part(blk, -2, sizeof(buf), &qiov, 0, 0); in test_sync_op_blk_pwritev_part()
202 static void test_sync_op_blk_pwrite_compressed(BlockBackend *blk) in test_sync_op_blk_pwrite_compressed() argument
208 ret = blk_pwrite_compressed(blk, 0, sizeof(buf), buf); in test_sync_op_blk_pwrite_compressed()
212 ret = blk_pwrite_compressed(blk, -2, sizeof(buf), buf); in test_sync_op_blk_pwrite_compressed()
216 static void test_sync_op_blk_pwrite_zeroes(BlockBackend *blk) in test_sync_op_blk_pwrite_zeroes() argument
221 ret = blk_pwrite_zeroes(blk, 0, 512, 0); in test_sync_op_blk_pwrite_zeroes()
225 ret = blk_pwrite_zeroes(blk, -2, 512, 0); in test_sync_op_blk_pwrite_zeroes()
268 static void test_sync_op_blk_pdiscard(BlockBackend *blk) in test_sync_op_blk_pdiscard() argument
273 ret = blk_pdiscard(blk, 0, 512); in test_sync_op_blk_pdiscard()
277 ret = blk_pdiscard(blk, -2, 512); in test_sync_op_blk_pdiscard()
302 static void test_sync_op_blk_truncate(BlockBackend *blk) in test_sync_op_blk_truncate() argument
307 ret = blk_truncate(blk, 65536, false, PREALLOC_MODE_OFF, 0, NULL); in test_sync_op_blk_truncate()
311 ret = blk_truncate(blk, -2, false, PREALLOC_MODE_OFF, 0, NULL); in test_sync_op_blk_truncate()
356 static void test_sync_op_blk_flush(BlockBackend *blk) in test_sync_op_blk_flush() argument
358 BlockDriverState *bs = blk_bs(blk); in test_sync_op_blk_flush()
362 ret = blk_flush(blk); in test_sync_op_blk_flush()
368 ret = blk_flush(blk); in test_sync_op_blk_flush()
397 void (*blkfn)(BlockBackend *blk);
470 BlockBackend *blk; in test_sync_op() local
476 blk = blk_new(qemu_get_aio_context(), BLK_PERM_ALL, BLK_PERM_ALL); in test_sync_op()
479 blk_insert_bs(blk, bs, &error_abort); in test_sync_op()
485 blk_set_aio_context(blk, ctx, &error_abort); in test_sync_op()
491 t->blkfn(blk); in test_sync_op()
493 blk_set_aio_context(blk, qemu_get_aio_context(), &error_abort); in test_sync_op()
497 blk_unref(blk); in test_sync_op()
555 BlockBackend *blk; in test_attach_blockjob() local
559 blk = blk_new(qemu_get_aio_context(), BLK_PERM_ALL, BLK_PERM_ALL); in test_attach_blockjob()
561 blk_insert_bs(blk, bs, &error_abort); in test_attach_blockjob()
572 blk_set_aio_context(blk, ctx, &error_abort); in test_attach_blockjob()
580 blk_set_aio_context(blk, qemu_get_aio_context(), &error_abort); in test_attach_blockjob()
588 blk_set_aio_context(blk, ctx, &error_abort); in test_attach_blockjob()
599 blk_set_aio_context(blk, qemu_get_aio_context(), &error_abort); in test_attach_blockjob()
603 blk_unref(blk); in test_attach_blockjob()
623 BlockBackend *blk; in test_propagate_basic() local
632 blk = blk_new(qemu_get_aio_context(), BLK_PERM_ALL & ~BLK_PERM_RESIZE, in test_propagate_basic()
635 blk_insert_bs(blk, bs_a, &error_abort); in test_propagate_basic()
649 blk_set_aio_context(blk, ctx, &error_abort); in test_propagate_basic()
650 g_assert(blk_get_aio_context(blk) == ctx); in test_propagate_basic()
658 blk_set_aio_context(blk, main_ctx, &error_abort); in test_propagate_basic()
660 g_assert(blk_get_aio_context(blk) == main_ctx); in test_propagate_basic()
668 blk_unref(blk); in test_propagate_basic()
689 BlockBackend *blk; in test_propagate_diamond() local
721 blk = blk_new(qemu_get_aio_context(), BLK_PERM_ALL & ~BLK_PERM_RESIZE, in test_propagate_diamond()
723 blk_insert_bs(blk, bs_verify, &error_abort); in test_propagate_diamond()
726 blk_set_aio_context(blk, ctx, &error_abort); in test_propagate_diamond()
727 g_assert(blk_get_aio_context(blk) == ctx); in test_propagate_diamond()
736 blk_set_aio_context(blk, main_ctx, &error_abort); in test_propagate_diamond()
738 g_assert(blk_get_aio_context(blk) == main_ctx); in test_propagate_diamond()
744 blk_unref(blk); in test_propagate_diamond()
757 BlockBackend *blk; in test_propagate_mirror() local
796 blk = blk_new(qemu_get_aio_context(), 0, BLK_PERM_ALL); in test_propagate_mirror()
797 blk_insert_bs(blk, src, &error_abort); in test_propagate_mirror()
802 g_assert(blk_get_aio_context(blk) == main_ctx); in test_propagate_mirror()
809 blk_set_allow_aio_context_change(blk, true); in test_propagate_mirror()
813 g_assert(blk_get_aio_context(blk) == ctx); in test_propagate_mirror()
821 blk_set_aio_context(blk, main_ctx, &error_abort); in test_propagate_mirror()
825 blk_unref(blk); in test_propagate_mirror()
835 BlockBackend *blk; in test_attach_second_node() local
840 blk = blk_new(ctx, BLK_PERM_ALL, BLK_PERM_ALL); in test_attach_second_node()
842 blk_insert_bs(blk, bs, &error_abort); in test_attach_second_node()
851 g_assert(blk_get_aio_context(blk) == ctx); in test_attach_second_node()
856 blk_set_aio_context(blk, main_ctx, &error_abort); in test_attach_second_node()
858 g_assert(blk_get_aio_context(blk) == main_ctx); in test_attach_second_node()
864 blk_unref(blk); in test_attach_second_node()
872 BlockBackend *blk; in test_attach_preserve_blk_ctx() local
876 blk = blk_new(ctx, BLK_PERM_ALL, BLK_PERM_ALL); in test_attach_preserve_blk_ctx()
881 blk_insert_bs(blk, bs, &error_abort); in test_attach_preserve_blk_ctx()
882 g_assert(blk_get_aio_context(blk) == ctx); in test_attach_preserve_blk_ctx()
888 blk_remove_bs(blk); in test_attach_preserve_blk_ctx()
890 g_assert(blk_get_aio_context(blk) == ctx); in test_attach_preserve_blk_ctx()
895 blk_insert_bs(blk, bs, &error_abort); in test_attach_preserve_blk_ctx()
897 g_assert(blk_get_aio_context(blk) == ctx); in test_attach_preserve_blk_ctx()
901 blk_set_aio_context(blk, qemu_get_aio_context(), &error_abort); in test_attach_preserve_blk_ctx()
904 blk_unref(blk); in test_attach_preserve_blk_ctx()