QEMU – How to Pass Command Line Args with Libvirt

libvirtqemu

I have the current libvirt 1.2.20
i want to pass to my machine create with virt-manager
some qemu flags.
I edited the file and add

  </devices>
  <qemu:commandline>
          <qemu:arg value='-L pc-bios'/>
  </qemu:commandline>
</domain>

But doesn't work
i also tried to edit from virsh

virsh edit domain

and put

<qemu:commandline>
          <qemu:arg value='-L pc-bios'/>
  </qemu:commandline>

But give me this error

errore: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng
Element domain has extra content: qemu:commandline

Failed. Try again? [y,n,i,f,?]: 

How to pass correctly qemu command line?
Thanks

Best Answer

elbarna's own answer is the way to go for configuration options "natively" supported by libvirt (and thus its domain XML). For qemu commandline arguments (and more) not supported by libvirt, you need to include qemu's XML namespace declaration in the 'domain' root element:

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>

Reference: https://libvirt.org/drvqemu.html#qemucommand

Related Question