Debugging Qemu

From stoney cloud
Revision as of 16:03, 5 June 2014 by Tiziano (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Jump to: navigation, search

Sometimes you must be able to analyse Qemu more in-depth than the log files allow to.

For this, one can attach a gdb instance to a running Qemu process if it is started with the -s option.

To pass the required option from libvirt down to Qemu, one can use an additional namespace to pass along options to Qemu as descripted in the libvirt wiki.

Simply replace at the beginning of the XML (for example when editing using virsh edit):

<domain type='kvm'>

by

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <qemu:commandline><qemu:arg value='-s'/></qemu:commandline>

and then start the VM.