[libvirt] virsh question

Eric Blake eblake at redhat.com
Mon Aug 23 13:56:46 UTC 2010


[again, adding the list]

On 08/23/2010 07:35 AM, Matthew Whitehead wrote:
> I want to enable gdb debugging for the qemu or qemu-kvm executables. The -s flag tells it to run qemu's gdbserver and -p tells the gdbserver to listen on a non-default (1234) port.

Yes, this sounds like a perfect fit for libvirt 0.8.3's qemu monitor 
support.  However, I did not implement that patch, so I'm not the best 
person to ask on how to modify your XML to inject those options. 
However, commit a71be01f04e7cac in libvirt.git includes some example XML 
that uses the new elements, such as:

+<domain type='qemu' 
xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory>219200</memory>
+  <currentMemory>219200</currentMemory>
+  <vcpu>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' unit='0'/>
+    </disk>
+    <controller type='ide' index='0'/>
+    <memballoon model='virtio'/>
+  </devices>
+  <qemu:commandline>
+    <qemu:arg value='-unknown'/>
+    <qemu:arg value='parameter'/>
+  </qemu:commandline>
+</domain>

So, I think it is as simple as passing <qemu:arg value='-p'/> from 
within your <domain> XML.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list