[Libguestfs] --with-qemu option in libguestfs

Richard W.M. Jones rjones at redhat.com
Fri Oct 6 07:41:11 UTC 2017


[Please keep replies on the mailing list so that others can
benefit from following the discussion]

On Fri, Oct 06, 2017 at 06:04:46AM +0000, emlyn.jose at wipro.com wrote:
> > qemu is a hypervisor, qemu-img is a program for manipulating disk
> > images.  They are very different things, and it makes no sense to
> > substitute qemu-img for qemu.
>
> I do not want to substitute qemu-img instead of qemu :
>
> • virt-resize uses qemu-kvm as well as qemu-img.
>
> • My qemu binaries come from a different path(instead of /usr/bin/)
>   which is set in $PATH already
>
> • Providing "export PATH=/path/to/qemu-kvm/and/qemu-img" (both
>   binaries are in same location) and using "--with
>   qemu=qemu-kvm qemu-img" takes only the qemu-kvm correctly

Don't use ‘--with-qemu=...qemu-img’, it is simply wrong.  The
--with-qemu parameter is intended to specify the hypervisor, and
qemu-img is not a hypervisor.

>   but qemu-img is still not taken from the $PATH. Why?

qemu-img comes from the PATH, see:

https://github.com/libguestfs/libguestfs/blob/master/lib/create.c#L317
https://github.com/libguestfs/libguestfs/blob/master/lib/info.c#L194

External commands run through the guestfs_int_cmd_* mechanism can be
displayed by enabling debugging:

http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs

so I suggest you enable this to see exactly what's going on.

> • I used "--with qemu=qemu-kvm qemu-img" as well as “export
>   LIBGUESTFS_HV=/path/to/qemu-img” which will obviously
>   override qemu-kvm to qemu-img
>
> Hope you got what I am saying now?
>
> I do not want to substitute qemu-img instead of qemu-kvm. Both has
> to be taken from the specified path i.e., $PATH.
>
> > P.S: Its surprising to see that even after uninstalling the available
> > qemu-img package from my host, libguestfs takes it without any
> > issues!! Where does it take that "qemu-img" binary from?
> 
> > From $PATH.
>
> How is that possible when there is no qemu-img installed which in
> turn has no such binary available in $PATH. That is weird!!!  I just
> want to know if libguestfs itself has some qemu-img binary inbuilt
> to use it for virt-resize.

You just said above that you set the PATH to contain both qemu-kvm and
qemu-img.

Anyway, I suggest you enable debugging which will show you exactly
what libguestfs is doing.  Also don't put qemu-img into the
‘./configure --with-qemu’ parameter.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/




More information about the Libguestfs mailing list