[libvirt-users] Libvirt adds extra parameters in domain XML

Andrea Bolognani abologna at redhat.com
Tue Oct 18 08:14:41 UTC 2016

On Mon, 2016-10-17 at 21:37 +0200, Marina Danial wrote:
> I need write the domain XML in libvirt to eventually convert
> it into these qemu commands.. I don't want to call qemu
> directly with these commands. So I needed assistance with
> that

If you're dead set on executing QEMU with those options,
and *only* those options, then libvirt is quite simply
not the tool you're looking for.

When you use libvirt, by definition you're giving up
fine-grained control of the specific options passed to
the underlying hypervisor and trust libvirt to translate
an high-level virtual hardware definition (guest XML)
into an appropriate QEMU command line.

Just to give you an example of why libvirt will never be
able to build exactly the command line you provided, we
rely on the QEMU monitor to eg. perform device hotplug,
so you will never see a QEMU process spawned by libvirt
that lacks the '-mon' option.

So your options are basically:

  1) switch to libvirt and accept the fact that your QEMU
     command lines will be quite a bit more verbose than
     they currently are

  2) keep spawning QEMU processes with hand-crafted
     command lines

I would of course recommend going for 1), as that will
allow you to use all of libvirt's features down the line,
when it eventually turns out you need them ;)

Andrea Bolognani / Red Hat / Virtualization

More information about the libvirt-users mailing list