Description of problem: virt-resize calculates the size of the block device using the host file size. This is completely wrong and it naturally miscalculates things like qcow2 targets. It should instead use the guestfs_blockdev_getsize64 API. Version-Release number of selected component (if applicable): 1.5.12 How reproducible: Always. Steps to Reproduce: 1. Create a qcow2 target file. 2. Try to resize with the qcow2 device as the target. 3. Actual results: Will fail or say the target image is too small. Expected results: Should calculate the target size correctly and thus not fail. Additional info: Originally reported by Sean Darcy here: https://www.redhat.com/archives/libguestfs/2010-September/msg00008.html
Current code that calculates image size: http://git.annexia.org/?p=libguestfs.git;a=blob;f=tools/virt-resize;h=28f51af1fac3438eecd84302b4f6e7164520e358;hb=HEAD#l533
Patch posted: https://www.redhat.com/archives/libguestfs/2010-September/msg00054.html