Bug 853762

Summary: virt-sparsify should use a more robust method to detect the input format
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: dyasny, mbooth
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 853763 (view as bug list) Environment:
Last Closed: 2012-09-03 17:36:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 853763    

Description Richard W.M. Jones 2012-09-02 18:33:21 UTC
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:


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.

Comment 1 Richard W.M. Jones 2012-09-03 17:36:12 UTC
Fixed in libguestfs 1.19.38.