]> git.proxmox.com Git - qemu.git/commit - qemu-img.c
block: add bdrv_get_allocated_file_size() operation
authorFam Zheng <famcool@gmail.com>
Tue, 12 Jul 2011 11:56:39 +0000 (19:56 +0800)
committerKevin Wolf <kwolf@redhat.com>
Tue, 19 Jul 2011 13:39:08 +0000 (15:39 +0200)
commit4a1d5e1fded54358ddc4d8cbd53388ca7c93499b
treee317502ecc47e7cf31ab53bbc3f4dd2c9b92c7f0
parentae261c86aaed62e7acddafab8262a2bf286d40b7
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>
block.c
block.h
block/raw-posix.c
block/raw-win32.c
block/vmdk.c
block_int.h
qemu-img.c