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()
490 t->blkfn(blk); in test_sync_op()
492 blk_set_aio_context(blk, qemu_get_aio_context(), &error_abort); in test_sync_op()
495 blk_unref(blk); in test_sync_op()
553 BlockBackend *blk; in test_attach_blockjob() local
557 blk = blk_new(qemu_get_aio_context(), BLK_PERM_ALL, BLK_PERM_ALL); in test_attach_blockjob()
559 blk_insert_bs(blk, bs, &error_abort); in test_attach_blockjob()
570 blk_set_aio_context(blk, ctx, &error_abort); in test_attach_blockjob()
577 blk_set_aio_context(blk, qemu_get_aio_context(), &error_abort); in test_attach_blockjob()
584 blk_set_aio_context(blk, ctx, &error_abort); in test_attach_blockjob()
594 blk_set_aio_context(blk, qemu_get_aio_context(), &error_abort); in test_attach_blockjob()
597 blk_unref(blk); in test_attach_blockjob()
617 BlockBackend *blk; in test_propagate_basic() local
626 blk = blk_new(qemu_get_aio_context(), BLK_PERM_ALL & ~BLK_PERM_RESIZE, in test_propagate_basic()
629 blk_insert_bs(blk, bs_a, &error_abort); in test_propagate_basic()
643 blk_set_aio_context(blk, ctx, &error_abort); in test_propagate_basic()
644 g_assert(blk_get_aio_context(blk) == ctx); in test_propagate_basic()
651 blk_set_aio_context(blk, main_ctx, &error_abort); in test_propagate_basic()
652 g_assert(blk_get_aio_context(blk) == main_ctx); in test_propagate_basic()
660 blk_unref(blk); in test_propagate_basic()
681 BlockBackend *blk; in test_propagate_diamond() local
713 blk = blk_new(qemu_get_aio_context(), BLK_PERM_ALL & ~BLK_PERM_RESIZE, in test_propagate_diamond()
715 blk_insert_bs(blk, bs_verify, &error_abort); in test_propagate_diamond()
718 blk_set_aio_context(blk, ctx, &error_abort); in test_propagate_diamond()
719 g_assert(blk_get_aio_context(blk) == ctx); in test_propagate_diamond()
727 blk_set_aio_context(blk, main_ctx, &error_abort); in test_propagate_diamond()
728 g_assert(blk_get_aio_context(blk) == main_ctx); in test_propagate_diamond()
734 blk_unref(blk); in test_propagate_diamond()
747 BlockBackend *blk; in test_propagate_mirror() local
782 blk = blk_new(qemu_get_aio_context(), 0, BLK_PERM_ALL); in test_propagate_mirror()
783 blk_insert_bs(blk, src, &error_abort); in test_propagate_mirror()
788 g_assert(blk_get_aio_context(blk) == main_ctx); in test_propagate_mirror()
794 blk_set_allow_aio_context_change(blk, true); in test_propagate_mirror()
797 g_assert(blk_get_aio_context(blk) == ctx); in test_propagate_mirror()
804 blk_set_aio_context(blk, main_ctx, &error_abort); in test_propagate_mirror()
807 blk_unref(blk); in test_propagate_mirror()
817 BlockBackend *blk; in test_attach_second_node() local
821 blk = blk_new(ctx, BLK_PERM_ALL, BLK_PERM_ALL); in test_attach_second_node()
823 blk_insert_bs(blk, bs, &error_abort); in test_attach_second_node()
831 g_assert(blk_get_aio_context(blk) == ctx); in test_attach_second_node()
835 blk_set_aio_context(blk, main_ctx, &error_abort); in test_attach_second_node()
836 g_assert(blk_get_aio_context(blk) == main_ctx); in test_attach_second_node()
842 blk_unref(blk); in test_attach_second_node()
849 BlockBackend *blk; in test_attach_preserve_blk_ctx() local
852 blk = blk_new(ctx, BLK_PERM_ALL, BLK_PERM_ALL); in test_attach_preserve_blk_ctx()
857 blk_insert_bs(blk, bs, &error_abort); in test_attach_preserve_blk_ctx()
858 g_assert(blk_get_aio_context(blk) == ctx); in test_attach_preserve_blk_ctx()
862 blk_remove_bs(blk); in test_attach_preserve_blk_ctx()
863 g_assert(blk_get_aio_context(blk) == ctx); in test_attach_preserve_blk_ctx()
867 blk_insert_bs(blk, bs, &error_abort); in test_attach_preserve_blk_ctx()
868 g_assert(blk_get_aio_context(blk) == ctx); in test_attach_preserve_blk_ctx()
871 blk_set_aio_context(blk, qemu_get_aio_context(), &error_abort); in test_attach_preserve_blk_ctx()
873 blk_unref(blk); in test_attach_preserve_blk_ctx()