RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 820869 - Fix automatic PCI address assignment for USB2 companion controllers
Summary: Fix automatic PCI address assignment for USB2 companion controllers
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Daniel Berrangé
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 803458 822160
TreeView+ depends on / blocked
 
Reported: 2012-05-11 09:05 UTC by Daniel Berrangé
Modified: 2012-06-20 06:58 UTC (History)
12 users (show)

Fixed In Version: libvirt-0.9.10-20.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 822160 (view as bug list)
Environment:
Last Closed: 2012-06-20 06:58:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 19:31:38 UTC

Description Daniel Berrangé 2012-05-11 09:05:59 UTC
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 Berrangé 2012-05-14 10:22:36 UTC
First cut of patch:

https://www.redhat.com/archives/libvir-list/2012-May/msg00722.html

Comment 6 Daniel Berrangé 2012-05-15 16:21:12 UTC
Fix comprises the following 3 upstream commits.

commit 03b804a200e214e3faf264b16f41a640c1344962
Author: Daniel P. Berrange <berrange>
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>
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>
Date:   Tue May 15 16:16:49 2012 +0100

    Fix virDomainDeviceInfoIsSet() to check all struct fields

Comment 10 weizhang 2012-05-17 15:52:13 UTC
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-18 02:31:29 UTC
(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 06:58:18 UTC
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.