From 4a1d5e1fded54358ddc4d8cbd53388ca7c93499b Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Tue, 12 Jul 2011 19:56:39 +0800 Subject: block: add bdrv_get_allocated_file_size() operation qemu-img.c wants to count allocated file size of image. Previously it counts a single bs->file by 'stat' or Window API. As VMDK introduces multiple file support, the operation becomes format specific with platform specific meanwhile. The functions are moved to block/raw-{posix,win32}.c and qemu-img.c calls bdrv_get_allocated_file_size to count the bs. And also added VMDK code to count his own extents. Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block_int.h | 1 + 1 file changed, 1 insertion(+) (limited to 'block_int.h') diff --git a/block_int.h b/block_int.h index 8a7b6cbb42..efb68038c4 100644 --- a/block_int.h +++ b/block_int.h @@ -86,6 +86,7 @@ struct BlockDriver { const char *protocol_name; int (*bdrv_truncate)(BlockDriverState *bs, int64_t offset); int64_t (*bdrv_getlength)(BlockDriverState *bs); + int64_t (*bdrv_get_allocated_file_size)(BlockDriverState *bs); int (*bdrv_write_compressed)(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors); -- cgit v1.2.3