[I don't normally monitor this list for issues - it's better to send bugs to the libguestfs mailing list] On Tue, Aug 28, 2012 at 09:07:23PM +0100, Paul Maunders wrote: > I've found an issue with virt-sparsify on Centos 6.3 with it's image > format detection. If I take a qcow2 image and attempt to sparsify it > with... > > virt-sparsify -v centos6.3-gold.img centos6.3-gold.img-sparsified > > ... it creates a raw file as it's output rather than a qcow2 file. In > the man page it says that the format should be preserved. In the log I > can see: > > qemu-img convert -f qcow2 -O 'raw' '/tmp/sparsifycfbc31.qcow2' > 'centos6.3-gold.img-sparsified' This is a bug: https://bugzilla.redhat.com/show_bug.cgi?id=853762 https://bugzilla.redhat.com/show_bug.cgi?id=853763 > However, if I manually set the input format and output format then it > works fine.... > > virt-sparsify -v --format qcow2 --convert qcow2 centos6.3-gold.img > centos6.3-gold.img-sparsified If you force the output format by using the --convert option then detection of the input format is not used at all. Same if you specify the input format using --format. > In the log I get: > > qemu-img convert -f qcow2 -O 'qcow2' '/tmp/sparsify2e15e4.qcow2' > 'centos6.3-gold.img-sparsified' > > I have version 1.16.19-1 of libguestfs-tools installed. I have also > tried on an Ubuntu system running an older version of the tools, and > it doesn't seem to have this problem. It depends on the version of the 'file' command that is installed, because the method used to detect the input format is not especially robust. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora