Bug 1271408

Summary: RFE: qemu: support configuring # of ports for qemu usb3 controller
Product: [Community] Virtualization Tools Reporter: Cole Robinson <crobinso>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: dyuan, kraxel, pzhang, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-03 13:03:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Cole Robinson 2015-10-13 22:15:46 UTC
According to Gerd here:

https://bugzilla.redhat.com/show_bug.cgi?id=1135488#c10

qemu's xhci controller has a configurable number of ports. libvirt should support that, since the default is only 4.

Comment 1 Cole Robinson 2015-10-13 22:23:54 UTC
Gerd, is this all that's required to give the xhci controller ex. 8 ports?

  -device nec-usb-xhci,p2=8,p3=8

Also, any opinions on if we should expose p2 vs p3 or just a single 'ports' knob? I don't know what the usecase for configuring only one or the other is...

Comment 2 Gerd Hoffmann 2015-10-14 05:48:22 UTC
p2 is the number of usb2 ports, p3 is the number of usb4 ports.  Ports do overlap.  So for example p2=8,p2=4 gives you a xhci controller where ports 1-4 can do both usb2 and usb3, whereas ports 5-8 are usb2 only.

That is mostly useful for debugging/testing purposes, for example forcing devices into usb2 mode on xhci to see whenever this works correctly.

I'd suggest to expose this as a single ports= property in libvirt.

Comment 3 Cole Robinson 2016-04-27 18:30:38 UTC
Patches posted upstream: http://www.redhat.com/archives/libvir-list/2016-April/msg01829.html

Comment 4 Cole Robinson 2016-05-03 13:03:51 UTC
Upstream now:

commit 600977e293ee97fc53a7ef17fb89cb310560e7ab
Author: Cole Robinson <crobinso>
Date:   Sat Apr 23 19:52:56 2016 -0400

    qemu: support configuring usb3 controller port count
    
    This adds a ports= attribute to usb controller XML, like
    
      <controller type='usb' model='nec-xhci' ports='8'/>
    
    This maps to:
    
      qemu -device nec-usb-xhci,p2=8,p3=8
    
    Meaning, 8 ports that support both usb2 and usb3 devices. Gerd
    suggested to just expose them as one knob.