On 05/14/2012 04:19 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Currently each USB2 companion controller gets put on a separate
PCI slot. Not only is this wasteful of PCI slots, but it is not
in compliance with the spec for USB2 controllers. The master
echi1 and all companion controllers should be in the same slot,
with echi1 in function 7, and uhci1-3 in functions 0-2 respectively.
* src/qemu/qemu_command.c: Special case handling of USB2 controllers
to apply correct pci slot assignment
* tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.args,
tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.xml: Expand
test to cover automatic slot assignment
---
src/qemu/qemu_command.c | 107 ++++++++++++++++----
.../qemuxml2argv-usb-ich9-ehci-addr.args | 15 ++-
.../qemuxml2argv-usb-ich9-ehci-addr.xml | 37 ++++++-
3 files changed, 138 insertions(+), 21 deletions(-)
+++ b/tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.xml
@@ -10,8 +10,43 @@
</os>
<devices>
<emulator>/usr/bin/qemu</emulator>
+ <!-- Intentionally mixed up ordering to check we assign
+ addresses to the correct matching companions -->
<controller type='usb' index='0' model='ich9-ehci1'>
- <address type='pci' domain='0' bus='0' slot='4'
function='7'/>
+ </controller>
Can we also add a matching file in qemuxml2xmloutdata/ to ensure that
qemuxml2xmltest converts the mixed up input into consistent output?
Other than that, ACK.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org