blkverify.c (fcb7e040f5c69ca1f0678f991ab5354488a9e192) | blkverify.c (c86422c5549c0983b4b4525b8f56a1c69dd67aa1) |
---|---|
1/* 2 * Block protocol for block driver correctness testing 3 * 4 * Copyright (C) 2010 IBM, Corp. 5 * 6 * This work is licensed under the terms of the GNU GPL, version 2 or later. 7 * See the COPYING file in the top-level directory. 8 */ --- 141 unchanged lines hidden (view full) --- 150static void blkverify_close(BlockDriverState *bs) 151{ 152 BDRVBlkverifyState *s = bs->opaque; 153 154 bdrv_unref_child(bs, s->test_file); 155 s->test_file = NULL; 156} 157 | 1/* 2 * Block protocol for block driver correctness testing 3 * 4 * Copyright (C) 2010 IBM, Corp. 5 * 6 * This work is licensed under the terms of the GNU GPL, version 2 or later. 7 * See the COPYING file in the top-level directory. 8 */ --- 141 unchanged lines hidden (view full) --- 150static void blkverify_close(BlockDriverState *bs) 151{ 152 BDRVBlkverifyState *s = bs->opaque; 153 154 bdrv_unref_child(bs, s->test_file); 155 s->test_file = NULL; 156} 157 |
158static int64_t blkverify_getlength(BlockDriverState *bs) | 158static int64_t coroutine_fn blkverify_co_getlength(BlockDriverState *bs) |
159{ 160 BDRVBlkverifyState *s = bs->opaque; 161 | 159{ 160 BDRVBlkverifyState *s = bs->opaque; 161 |
162 return bdrv_getlength(s->test_file->bs); | 162 return bdrv_co_getlength(s->test_file->bs); |
163} 164 165static void coroutine_fn blkverify_do_test_req(void *opaque) 166{ 167 BlkverifyRequest *r = opaque; 168 BDRVBlkverifyState *s = r->bs->opaque; 169 170 r->ret = r->request_fn(s->test_file, r->offset, r->bytes, r->qiov, --- 138 unchanged lines hidden (view full) --- 309 .format_name = "blkverify", 310 .protocol_name = "blkverify", 311 .instance_size = sizeof(BDRVBlkverifyState), 312 313 .bdrv_parse_filename = blkverify_parse_filename, 314 .bdrv_file_open = blkverify_open, 315 .bdrv_close = blkverify_close, 316 .bdrv_child_perm = bdrv_default_perms, | 163} 164 165static void coroutine_fn blkverify_do_test_req(void *opaque) 166{ 167 BlkverifyRequest *r = opaque; 168 BDRVBlkverifyState *s = r->bs->opaque; 169 170 r->ret = r->request_fn(s->test_file, r->offset, r->bytes, r->qiov, --- 138 unchanged lines hidden (view full) --- 309 .format_name = "blkverify", 310 .protocol_name = "blkverify", 311 .instance_size = sizeof(BDRVBlkverifyState), 312 313 .bdrv_parse_filename = blkverify_parse_filename, 314 .bdrv_file_open = blkverify_open, 315 .bdrv_close = blkverify_close, 316 .bdrv_child_perm = bdrv_default_perms, |
317 .bdrv_getlength = blkverify_getlength, | 317 .bdrv_co_getlength = blkverify_co_getlength, |
318 .bdrv_refresh_filename = blkverify_refresh_filename, 319 .bdrv_dirname = blkverify_dirname, 320 321 .bdrv_co_preadv = blkverify_co_preadv, 322 .bdrv_co_pwritev = blkverify_co_pwritev, 323 .bdrv_co_flush = blkverify_co_flush, 324 325 .is_filter = true, 326 .bdrv_recurse_can_replace = blkverify_recurse_can_replace, 327}; 328 329static void bdrv_blkverify_init(void) 330{ 331 bdrv_register(&bdrv_blkverify); 332} 333 334block_init(bdrv_blkverify_init); | 318 .bdrv_refresh_filename = blkverify_refresh_filename, 319 .bdrv_dirname = blkverify_dirname, 320 321 .bdrv_co_preadv = blkverify_co_preadv, 322 .bdrv_co_pwritev = blkverify_co_pwritev, 323 .bdrv_co_flush = blkverify_co_flush, 324 325 .is_filter = true, 326 .bdrv_recurse_can_replace = blkverify_recurse_can_replace, 327}; 328 329static void bdrv_blkverify_init(void) 330{ 331 bdrv_register(&bdrv_blkverify); 332} 333 334block_init(bdrv_blkverify_init); |