Bug 1531480

Summary: ccid controller can not be attached to usb hub
Product: Red Hat Enterprise Linux 7 Reporter: yalzhang <yalzhang>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DUPLICATE QA Contact: Jing Qi <jinqi>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: jinqi, jiyan, jtomko, rbalakri, xuzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-05 10:10:21 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 yalzhang@redhat.com 2018-01-05 09:47:01 UTC
Description of problem:
ccid controller can not be attached to usb hub

Version-Release number of selected component (if applicable):
libvirt-3.9.0-7.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.  prepare guest xml with 1 usb3 controller, and 3 devices connected to the controller. 
 # virsh dumpxml pc
<controller type='usb' index='0' model='nec-xhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
...
<input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='1'/>
    </input>
 <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='2'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='3'/>
    </redirdev>


2.  edit the xml to add 1 ccid controller and 1 usb disk
# virsh edit pc
...
   <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/pc-2.qcow2'/>
      <target dev='sdx' bus='usb'/>
    </disk>
<controller type='ccid'/>
...
As usb3 only support 4 ports, a hub will be added, and the usb disk and ccid controller will attached to the hub
# virsh dumpxml pc 
...
  <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/pc-2.qcow2'/>
      <target dev='sdx' bus='usb'/>
      <address type='usb' bus='0' port='4.1'/>
    </disk>
    <controller type='ccid' index='0'>
      <address type='usb' bus='0' port='4.2'/>
    </controller>
...
  <hub type='usb'>
      <address type='usb' bus='0' port='4'/>
    </hub>

3. guest can not start 
# virsh start pc
error: Failed to start domain pc
error: internal error: process exited while connecting to monitor: 2018-01-05T08:10:12.703102Z qemu-kvm: -device usb-ccid,id=ccid0,bus=usb.0,port=4.2: usb port 4.2 (bus usb.0) not found (in use?)


Actual results:
ccid controller can not be attached to usb hub
 
Expected results:
guest can start successfully, or there is error message about ccid controller can not attached to usb hub

Additional info:
If there is 2 usb disk with  adress like <address type='usb' bus='0' port='4.1'/>, <address type='usb' bus='0' port='4.2'/>, the guest can start successfully.

Comment 2 Ján Tomko 2018-01-05 10:10:21 UTC

*** This bug has been marked as a duplicate of bug 1375402 ***