[libvirt] [PATCH] Fix sparse volume allocation reporting

Cole Robinson crobinso at redhat.com
Tue Mar 24 19:29:21 UTC 2009


I have a sparse volume with a capacity of 1000M, and an allocation of a
little over 750M. 'du' prints the correct sizes, but 'virsh vol-dumpxml'
shows:

    <capacity>1048576000</capacity>
  <allocation>6406307840</allocation>

This is because we were calculating the allocation size using the
requested fs block size, instead of what stat actually uses as a block
size (DEV_BSIZE in sys/params.h). sys/params.h looks to be present in
mingw32-runtime, so I didn't add a configure check for it.

The attached patch fixes allocation listing for me.

Thanks,
Cole
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-fix-sparse-allocation.patch
Type: text/x-patch
Size: 882 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20090324/9aef44e1/attachment-0001.bin>


More information about the libvir-list mailing list