
On Mon, May 14, 2012 at 03:55:50PM -0600, Eric Blake wrote:
On 05/14/2012 04:19 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@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?
I added a test case and it showed my USB code is correct, but it found a pre-existing flaw in other area causing us to drop info when saving the XML ! https://www.redhat.com/archives/libvir-list/2012-May/msg00811.html Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|