Bug 1461633 - libvirt should add extra hubs when cold/hot-pluging more USB devices
libvirt should add extra hubs when cold/hot-pluging more USB devices
Status: ASSIGNED
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.4
x86_64 Unspecified
medium Severity medium
: rc
: ---
Assigned To: Ján Tomko
lijuan men
:
Depends On:
Blocks: 1473046
  Show dependency treegraph
 
Reported: 2017-06-14 22:40 EDT by Pei Zhang
Modified: 2018-05-24 05:10 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Pei Zhang 2017-06-14 22:40:27 EDT
Description of problem:
libvirt should add extra hubs when cold/hot-pluging more USB devices 

Version-Release number of selected component (if applicable):
libvirt-3.2.0-10.el7.x86_64
qemu-kvm-rhev-2.9.0-10.el7.x86_64

How reproducible:
100%

Steps to Reproduce:

1. Define a guest without USB disks.

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     vm1                            shut off

# virsh domblklist vm1
Target     Source
------------------------------------------------
vda        /var/lib/libvirt/images/r74.qcow2

# virsh dumpxml vm1 | grep usb -A 3
......
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
    </controller>
--
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='1'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='2'/>
    </redirdev>

2. Cold plug multiple USB disks 
# for i in {a..h}; do virsh attach-disk vm1 /var/lib/libvirt/images/usb/usb$i.img --targetbus usb sd$i --config; done 
Disk attached successfully

Disk attached successfully

Disk attached successfully

Disk attached successfully

error: Failed to attach disk
error: internal error: No free USB ports

error: Failed to attach disk
error: internal error: No free USB ports
......

3. Trying to hotplug multiple USB disks, also hit this issue. 

Actual results:
As step2, libvirt will not add extra hub when no free ports

Expected results:
Add enough hubs when cold/hot pluging more usb devices

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