Bug 820869 - Fix automatic PCI address assignment for USB2 companion controllers
Fix automatic PCI address assignment for USB2 companion controllers
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.4
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Daniel Berrange
Virtualization Bugs
:
Depends On:
Blocks: 803458 822160
  Show dependency treegraph
 
Reported: 2012-05-11 05:05 EDT by Daniel Berrange
Modified: 2012-06-20 02:58 EDT (History)
12 users (show)

See Also:
Fixed In Version: libvirt-0.9.10-20.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 822160 (view as bug list)
Environment:
Last Closed: 2012-06-20 02:58:18 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Daniel Berrange 2012-05-11 05:05:59 EDT
Description of problem:
When creating a USB2 controller, there are actually 4 devices. The primary ehci controller and 3 companion uhci controllers. The PCI address assignment code is not aware of the special requirement that these 4 devices should be configured to use just 1 slot with multi-function turned on.

Version-Release number of selected component (if applicable):
libvirt-0.9.10-16.el6

How reproducible:
Always

Steps to Reproduce:
1. Add the following XML to a guest

    <controller type='usb' index='0' model='ich9-ehci1'/>
    <controller type='usb' index='0' model='ich9-uhci1'/>
    <controller type='usb' index='0' model='ich9-uhci2'/>
    <controller type='usb' index='0' model='ich9-uhci3'/>

Actual results:
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
    </controller>

Expected results:
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x2'/>
    </controller>


Additional info:
Comment 3 Daniel Berrange 2012-05-14 06:22:36 EDT
First cut of patch:

https://www.redhat.com/archives/libvir-list/2012-May/msg00722.html
Comment 6 Daniel Berrange 2012-05-15 12:21:12 EDT
Fix comprises the following 3 upstream commits.

commit 03b804a200e214e3faf264b16f41a640c1344962
Author: Daniel P. Berrange <berrange@redhat.com>
Date:   Mon May 14 13:22:58 2012 +0100

    Set a sensible default master start port for ehci companion controllers
    
commit 1ebd52cb871f87b7868503b28448e96d59e41d63
Author: Daniel P. Berrange <berrange@redhat.com>
Date:   Mon May 14 11:16:22 2012 +0100

    Fix logic for assigning PCI addresses to USB2 companion controllers

commit 2c195fdbf3293792e39bc4f06755ae751025b0ea
Author: Daniel P. Berrange <berrange@redhat.com>
Date:   Tue May 15 16:16:49 2012 +0100

    Fix virDomainDeviceInfoIsSet() to check all struct fields
Comment 10 weizhang 2012-05-17 11:52:13 EDT
verify pass on 
qemu-kvm-0.12.1.2-2.292.el6.x86_64
kernel-2.6.32-270.el6.x86_64
libvirt-0.9.10-20.el6.x86_64


After start guest with 4 usb controller like
    <controller type='usb' index='0' model='ich9-ehci1'/>
    <controller type='usb' index='0' model='ich9-uhci1'/>
    <controller type='usb' index='0' model='ich9-uhci2'/>
    <controller type='usb' index='0' model='ich9-uhci3'/>

dumpxml will show
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb0'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <alias name='usb0'/>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <alias name='usb0'/>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x2'/>
Comment 11 Alex Jia 2012-05-17 22:31:29 EDT
(In reply to comment #10)
> verify pass on 
> qemu-kvm-0.12.1.2-2.292.el6.x86_64
> kernel-2.6.32-270.el6.x86_64
> libvirt-0.9.10-20.el6.x86_64
> 
> 
> After start guest with 4 usb controller like
>     <controller type='usb' index='0' model='ich9-ehci1'/>
>     <controller type='usb' index='0' model='ich9-uhci1'/>
>     <controller type='usb' index='0' model='ich9-uhci2'/>
>     <controller type='usb' index='0' model='ich9-uhci3'/>
> 
> dumpxml will show
Incomplete, it had better to log in guest then check whether these 4 controllers  use just 1 slot by lspci.
Comment 14 errata-xmlrpc 2012-06-20 02:58:18 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0748.html

Note You need to log in before you can comment on or make changes to this bug.