[libvirt-users] Passing non-standard Options through Libvirt to QEMU

Hello, I have a custom QEMU which requires some non-standard command line arguments to launch a VM. e.g., "--proc-type=secondary" option is always required to launch a QEMU VM. To launch the VM through libvirt (virsh) "How do I specify these non-standard options in XML? OR if thats not possible ,Can you guide me at which point (code file) libvirt converts the XML to QEMU command (so that I can insert the option there). Regards -- Asadullah Hussain

On Mon, Mar 31, 2014 at 04:33:40PM +0500, Asadullah Hussain wrote:
Hello, I have a custom QEMU which requires some non-standard command line arguments to launch a VM. e.g., "--proc-type=secondary" option is always required to launch a QEMU VM.
To launch the VM through libvirt (virsh) "How do I specify these non-standard options in XML?
See this page http://libvirt.org/drvqemu.html#qemucommand Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

There are a couple of problems with passthrough qemu: 1. virsh version/capabilities command executes "qemu -help" but this gives an error in my case because my customized qemu has to receive mandatory non-standard parameters "qemu -c -n -- -help". 2. Similarly when passing arguments as passthrough in a VMs XML. How can I make sure that these non-standard arguments are passed first i.e., My qemu command for a VM should be "qemu -c -n -- <Rest of the standard parameters>" On 31 March 2014 16:45, Daniel P. Berrange <berrange@redhat.com> wrote:
On Mon, Mar 31, 2014 at 04:33:40PM +0500, Asadullah Hussain wrote:
Hello, I have a custom QEMU which requires some non-standard command line arguments to launch a VM. e.g., "--proc-type=secondary" option is always required to launch a QEMU VM.
To launch the VM through libvirt (virsh) "How do I specify these non-standard options in XML?
See this page
http://libvirt.org/drvqemu.html#qemucommand
Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/:| |: http://libvirt.org -o- http://virt-manager.org:| |: http://autobuild.org -o- http://search.cpan.org/~danberr/:| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc:|
-- Asadullah Hussain

On Thu, Apr 10, 2014 at 11:31:11AM +0500, Asadullah Hussain wrote:
There are a couple of problems with passthrough qemu:
1. virsh version/capabilities command executes "qemu -help" but this gives an error in my case because my customized qemu has to receive mandatory non-standard parameters "qemu -c -n -- -help".
Two things - With any reasoanbly recent QEMU version, libvirt no longer uses -help but instead probes via QMP. it runs $QEMU -S -no-user-config -nodefaults -nographic -M none -qmp ..somepath... -pidfile ...somepath... --daemonize - If you are customizing QEMU it is your responsibility to ensure you don't break the above invocation, or equivalently qemu -help. Requiring mandatory non-standard args in either of these cases is just plain broken design. You should only require those args when actually running a full QEMU VM.
2. Similarly when passing arguments as passthrough in a VMs XML. How can I make sure that these non-standard arguments are passed first i.e., My qemu command for a VM should be "qemu -c -n -- <Rest of the standard parameters>"
You can't - you should allow the args to appear in any order. Command line flag order should not be relevant. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (2)
-
Asadullah Hussain
-
Daniel P. Berrange