blkverify.c (f1ab7a5acf08dcc11638b22660ed87d5f6d633c2) | blkverify.c (4f6fd3491cf0f768b135ed2e242bd1d1d2a2efec) |
---|---|
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) --- 150 if (filename == NULL) { 151 ret = -EINVAL; 152 goto fail; 153 } 154 155 s->test_file = bdrv_new(""); 156 ret = bdrv_open(s->test_file, filename, NULL, flags, NULL); 157 if (ret < 0) { | 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) --- 150 if (filename == NULL) { 151 ret = -EINVAL; 152 goto fail; 153 } 154 155 s->test_file = bdrv_new(""); 156 ret = bdrv_open(s->test_file, filename, NULL, flags, NULL); 157 if (ret < 0) { |
158 bdrv_delete(s->test_file); | 158 bdrv_unref(s->test_file); |
159 s->test_file = NULL; 160 goto fail; 161 } 162 163 ret = 0; 164fail: 165 return ret; 166} 167 168static void blkverify_close(BlockDriverState *bs) 169{ 170 BDRVBlkverifyState *s = bs->opaque; 171 | 159 s->test_file = NULL; 160 goto fail; 161 } 162 163 ret = 0; 164fail: 165 return ret; 166} 167 168static void blkverify_close(BlockDriverState *bs) 169{ 170 BDRVBlkverifyState *s = bs->opaque; 171 |
172 bdrv_delete(s->test_file); | 172 bdrv_unref(s->test_file); |
173 s->test_file = NULL; 174} 175 176static int64_t blkverify_getlength(BlockDriverState *bs) 177{ 178 BDRVBlkverifyState *s = bs->opaque; 179 180 return bdrv_getlength(s->test_file); --- 242 unchanged lines hidden --- | 173 s->test_file = NULL; 174} 175 176static int64_t blkverify_getlength(BlockDriverState *bs) 177{ 178 BDRVBlkverifyState *s = bs->opaque; 179 180 return bdrv_getlength(s->test_file); --- 242 unchanged lines hidden --- |