Red Hat Bugzilla – Bug 853762
virt-sparsify should use a more robust method to detect the input format
Last modified: 2012-09-03 13:36:24 EDT
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):
Steps to Reproduce:
1. Use virt-sparsify on a file.
2. Don't specify the --convert argument.
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.