Description of problem: Currently virt-sparsify runs the 'file -bsL' command on the input disk image to try to detect the format. This is not robust as 'file' is often broken or might not know about the disk format. 'file' has also been known to print different things for different versions of the command, which is why virt-sparsify breaks in RHEL 6.3: rhel$ file -bsL /tmp/disk.qcow2 Qemu Image, Format: Qcow , Version: 2 fedora$ file -bsL /tmp/disk.qcow2 QEMU QCOW Image (v2), 10485760 bytes Version-Release number of selected component (if applicable): libguestfs 1.16.19 How reproducible: 100% Steps to Reproduce: 1. Use virt-sparsify on a file. 2. Don't specify the --convert argument. Actual results: Results will depend on the input format and the version of 'file' installed. For example on RHEL 6.3 it will detect the input format as raw, and so produce a raw output file.
Fixed in libguestfs 1.19.38.