Lines Matching refs:blk
33 static BlockJob *mk_job(BlockBackend *blk, const char *id, in mk_job() argument
40 job = block_job_create(id, drv, NULL, blk_bs(blk), in mk_job()
49 g_assert_cmpstr(job->job.id, ==, blk_name(blk)); in mk_job()
59 static BlockJob *do_test_id(BlockBackend *blk, const char *id, in do_test_id() argument
62 return mk_job(blk, id, &test_block_job_driver, in do_test_id()
71 BlockBackend *blk = blk_new(qemu_get_aio_context(), 0, BLK_PERM_ALL); in create_blk() local
79 blk_insert_bs(blk, bs, &error_abort); in create_blk()
84 monitor_add_blk(blk, name, &err); in create_blk()
88 return blk; in create_blk()
92 static void destroy_blk(BlockBackend *blk) in destroy_blk() argument
94 if (blk_name(blk)[0] != '\0') { in destroy_blk() local
95 monitor_remove_blk(blk); in destroy_blk()
98 blk_remove_bs(blk); in destroy_blk()
99 blk_unref(blk); in destroy_blk()
104 BlockBackend *blk[3]; in test_job_ids() local
107 blk[0] = create_blk(NULL); in test_job_ids()
108 blk[1] = create_blk("drive1"); in test_job_ids()
109 blk[2] = create_blk("drive2"); in test_job_ids()
112 job[0] = do_test_id(blk[0], NULL, false); in test_job_ids()
115 job[0] = do_test_id(blk[0], "0id", false); in test_job_ids()
116 job[0] = do_test_id(blk[0], "", false); in test_job_ids()
117 job[0] = do_test_id(blk[0], " ", false); in test_job_ids()
118 job[0] = do_test_id(blk[0], "123", false); in test_job_ids()
119 job[0] = do_test_id(blk[0], "_id", false); in test_job_ids()
120 job[0] = do_test_id(blk[0], "-id", false); in test_job_ids()
121 job[0] = do_test_id(blk[0], ".id", false); in test_job_ids()
122 job[0] = do_test_id(blk[0], "#id", false); in test_job_ids()
125 job[0] = do_test_id(blk[0], "id0", true); in test_job_ids()
128 job[1] = do_test_id(blk[0], "id1", true); in test_job_ids()
132 job[1] = do_test_id(blk[1], "id0", false); in test_job_ids()
136 job[1] = do_test_id(blk[1], "id0", true); in test_job_ids()
140 job[1] = do_test_id(blk[1], NULL, true); in test_job_ids()
143 job[2] = do_test_id(blk[2], "drive1", false); in test_job_ids()
146 job[0] = do_test_id(blk[0], "drive2", true); in test_job_ids()
147 job[2] = do_test_id(blk[2], NULL, false); in test_job_ids()
150 job[2] = do_test_id(blk[2], "id_2", true); in test_job_ids()
156 destroy_blk(blk[0]); in test_job_ids()
157 destroy_blk(blk[1]); in test_job_ids()
158 destroy_blk(blk[2]); in test_job_ids()
163 BlockBackend *blk; member
205 BlockBackend *blk; in create_common() local
210 blk = create_blk(NULL); in create_common()
211 bjob = mk_job(blk, "Steve", &test_cancel_driver, true, in create_common()
220 s->blk = blk; in create_common()
229 BlockBackend *blk = s->blk; in cancel_common() local
242 destroy_blk(blk); in cancel_common()