<div dir="ltr"><div class="gmail_extra"><div>On Fri, May 31, 2013 at 7:25 PM, Richard W.M. Jones <span dir="ltr"><<a href="mailto:rjones@redhat.com" target="_blank">rjones@redhat.com</a>></span> wrote:<br></div><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On Fri, May 31, 2013 at 06:39:53PM +0800, Qiu Yu wrote:<br>


> [00098ms] /usr/libexec/qemu-kvm \<br>
>     -global virtio-blk-pci.scsi=off \<br>
>     -drive file=/dev/xenvg/123,cache=off,format=qcow2,if=virtio \<br>
>     -nodefconfig \<br>
>     -enable-kvm \<br>
>     -nodefaults \<br>
>     -nographic \<br>
>     -m 500 \<br>
>     -no-reboot \<br>
>     -device virtio-serial \<br>
>     -serial stdio \<br>
>     -chardev socket,path=/tmp/libguestfssaaw6T/guestfsd.sock,id=channel0 \<br>
>     -device virtserialport,chardev=channel0,name=org.libguestfs.channel.0 \<br>
>     -kernel /var/tmp/.guestfs-501/kernel.30285 \<br>
>     -initrd /var/tmp/.guestfs-501/initrd.30285 \<br>
>     -append 'panic=1 console=ttyS0 udevtimeout=300 no_timer_check acpi=off<br>
> printk.time=1 cgroup_disable=memory selinux=0 guestfs_verbose=1<br>
> TERM=screen-bce ' \<br>
>     -drive<br>
> file=/var/tmp/.guestfs-501/root.30285,snapshot=on,if=virtio,cache=unsafeqemu-kvm:<br>
> -drive file=/dev/xenvg/123,cache=off,format=qcow2,if=virtio: could not open<br>
> disk image /dev/xenvg/123: Invalid argument<br>
<br>
</div>I'm assuming it's because the format is wrong (ie. not qcow2 but raw).<br>
<br>
The error message is a little bit obscure and could be better, but we<br>
do rely on qemu printing something sensible instead of just "Invalid<br>
argument".<br> <br></blockquote></div><br></div><div class="gmail_extra" style>Oh, yes. It's indeed the wrong 'format' argument causing the issue. Sorry I'm not familiar with libguestfs, 'invalid argument' should be an obvious hint for me to follow on.</div>

<div class="gmail_extra" style><br></div><div class="gmail_extra" style>For others who might interests, if you use qcow2 image with OpenStack and choose LVM as image backend, nova libvirt driver will convert it raw when creating a new instance. However, data injection using libguestfs will still assuming the it is qcow2 format, hence hit the above issue. Not sure it is a bug or not, probably one should specify "use_cow_images = False" to avoid the problem in this case.</div>

<div class="gmail_extra" style><br></div><div class="gmail_extra" style>--</div><div class="gmail_extra" style>Qiu Yu</div></div>