[libvirt] how to pass qemu options?

Gerd Hoffmann kraxel at redhat.com
Thu May 15 07:10:31 UTC 2008


David Abrahams wrote:
> I normally launch my kvm VM from the command line with "-redir tcp:3389:3389"
> but have been unable to find a way to set up virt-manager to launch it the same
> way.  Ditto for other qemu options such as "-soundhw all".  Is there a way?

Not directly in the config.  Usual trick is to create a wrapper script
like this (for a serial console in that case) ...

  [root at xeni f8-32]# cat /root/bin/qemu-serial
  #!/bin/sh
  exec /usr/bin/qemu-kvm "$@" -serial telnet::9999,server,nowait,nodelay

... then edit the xml config to make the <emulator> tag point to the
wrapper script instead of /usr/bin/qemu-kvm.

Hmm, maybe the emulator tag should get a args attribute, so one can do
that kind of stuff without wrapper scripts, like this:

  <domain type='kvm'>
    [ ... ]
    <devices>
      <emulator args="-redir ...">/usr/bin/qemu-kvm</emulator>
  [ ... ]

The usual ones should be supported by libvirt directly of course.
Serial console is in cvs meanwhile, I've seen also sound support
patches.  But for unusual configurations and debugging purposes it would
be quite handy to have the additional args directly in the config and
not hidden somewhere in a separate script ...

comments?

cheers,
  Gerd

-- 
http://kraxel.fedorapeople.org/xenner/




More information about the libvir-list mailing list