diff options
author | Fam Zheng <famcool@gmail.com> | 2011-07-12 19:56:39 +0800 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-07-19 15:39:08 +0200 |
commit | 4080218a50e9e4f2506ec9c218d47491dc8f1588 (patch) | |
tree | e317502ecc47e7cf31ab53bbc3f4dd2c9b92c7f0 /block.h | |
parent | d41329ef14955078dcfd9a834477461e5680e1d2 (diff) | |
download | qemu-4080218a50e9e4f2506ec9c218d47491dc8f1588.tar.gz qemu-4080218a50e9e4f2506ec9c218d47491dc8f1588.tar.bz2 qemu-4080218a50e9e4f2506ec9c218d47491dc8f1588.zip |
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 <famcool@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.h')
-rw-r--r-- | block.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -89,6 +89,7 @@ int bdrv_write_sync(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors); int bdrv_truncate(BlockDriverState *bs, int64_t offset); int64_t bdrv_getlength(BlockDriverState *bs); +int64_t bdrv_get_allocated_file_size(BlockDriverState *bs); void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr); void bdrv_guess_geometry(BlockDriverState *bs, int *pcyls, int *pheads, int *psecs); int bdrv_commit(BlockDriverState *bs); |