From ba34fe2250b605739b525051e5f5350b5c3d714f Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Tue, 29 Jun 2010 11:43:13 +0200 Subject: qemu-img check: Distinguish different kinds of errors People think that their images are corrupted when in fact there are just some leaked clusters. Differentiating several error cases should make the messages more comprehensible. Signed-off-by: Kevin Wolf --- block.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'block.h') diff --git a/block.h b/block.h index 3d03b3e041..c2a7e4c762 100644 --- a/block.h +++ b/block.h @@ -74,7 +74,6 @@ void bdrv_close(BlockDriverState *bs); int bdrv_attach(BlockDriverState *bs, DeviceState *qdev); void bdrv_detach(BlockDriverState *bs, DeviceState *qdev); DeviceState *bdrv_get_attached(BlockDriverState *bs); -int bdrv_check(BlockDriverState *bs); int bdrv_read(BlockDriverState *bs, int64_t sector_num, uint8_t *buf, int nb_sectors); int bdrv_write(BlockDriverState *bs, int64_t sector_num, @@ -97,6 +96,15 @@ int bdrv_change_backing_file(BlockDriverState *bs, const char *backing_file, const char *backing_fmt); void bdrv_register(BlockDriver *bdrv); + +typedef struct BdrvCheckResult { + int corruptions; + int leaks; + int check_errors; +} BdrvCheckResult; + +int bdrv_check(BlockDriverState *bs, BdrvCheckResult *res); + /* async block I/O */ typedef struct BlockDriverAIOCB BlockDriverAIOCB; typedef void BlockDriverCompletionFunc(void *opaque, int ret); -- cgit v1.2.3