I find this curious behavior that libvirt will automatically insert a USB controller and a memballoon virtio driver into the domain’s XML, when defineXML is called. IOW, the original XML did not have these 2 devices but they are present right after defineXML is called. Why should libvirt add a USB controller?
Here is a little Python snippet to show that behavior:
conn = libvirt.open('qemu:///system')
xml_list = open('/tmp/vm.xml', "r").readlines()
in_xml = ''.join(xml_list) ß This XML string does not have a USB or a memballoon
dom = conn.defineXML(in_xml)
out_xml = dom.XMLDesc() ß But this XML string does!
The file /tmp/vm.xml does not have a memballoon or a USB device. Neither, of course, does in_xml string. But out_xml has:
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
I don’t see anything in libvirt.conf that explains this. This is libvirt version: 1.2.8, package: 16.el7_1.5 (Red Hat, Inc....). The host is RHEL 7.1.
The memballoon part is understandable once I found: https://www.redhat.com/archives/libvir-list/2010-August/msg00132.html
However, why should libvirt add a USB controller gratuitously? Is this controllable from the conf file?
This message may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that any use, disclosure, dissemination, distribution, or copying of this message, or any attachments, is strictly prohibited. If you have received this message in error, please advise the sender by reply e-mail, and delete the message and any attachments. Thank you.