Bug 1599971 - Guest fails to start when it has a ccid plugged on hub
Summary: Guest fails to start when it has a ccid plugged on hub
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 8.0
Assignee: Ján Tomko
QA Contact: lijuan men
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-11 04:37 UTC by jiyan
Modified: 2020-11-14 05:31 UTC (History)
10 users (show)

Fixed In Version: libvirt-5.3.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1375402
Environment:
Last Closed: 2019-11-06 07:11:37 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:3723 0 None None None 2019-11-06 07:11:52 UTC

Description jiyan 2018-07-11 04:37:29 UTC
This issue is able to be reproduced in RHEL8.
libvirt-4.3.0-1.el8+732+cd548b25.x86_64
kernel-4.17.0-6.el8+7.x86_64
qemu-kvm-2.12.0-13.el8+812+c321fc4d.x86_64

+++ This bug was initially created as a clone of Bug #1375402 +++

Description of problem:
Since usb-ccid controllers are formatted before usb-hubs on the QEMU command line, so guest will fail to start if plug a ccid controller on hub.

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

How reproducible:
100%

Steps to Reproduce:
1. define and edit a guest like following :
#virsh dumpxml vm2 
......
<controller type='ccid' index='0'>
      <address type='usb' bus='0' port='6.1'/>
    </controller>
  <smartcard mode='passthrough' type='spicevmc'>
      <address type='ccid' controller='0' slot='0'/>
    </smartcard>
......

2. start guest 
# virsh start vm2
error: Failed to start domain vm2
error: internal error: qemu unexpectedly closed the monitor: 2016-09-12T09:47:46.638568Z qemu-kvm: -device usb-ccid,id=ccid0,bus=usb.0,port=6.1: usb port 6.1 (bus usb.0) not found (in use?)


Actual results:
As step 2, guest with usb-ccid on hub fail to start.

Expected results:
Guest can start successfully or give some error like we cannot use it in this way.


Additional info:

--- Additional comment from Ján Tomko on 2018-01-05 05:10:21 EST ---

Comment 1 Ján Tomko 2019-01-16 07:56:45 UTC
Upstream patches:
https://www.redhat.com/archives/libvir-list/2019-January/msg00498.html

Comment 2 Ján Tomko 2019-01-25 14:03:10 UTC
Pushed upstream as:
commit c7e03df8c0f38bb007523c022e628581948e8f01
Author:     Ján Tomko <jtomko>
CommitDate: 2019-01-25 14:58:35 +0100

    qemu: format CCID controllers after USB hubs
    
    Since they go on the USB bus, format them after USB hubs.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1375402
    
    Signed-off-by: Ján Tomko <jtomko>
    Reviewed-by: Cole Robinson <crobinso>

git describe: v5.0.0-117-gc7e03df8c0

Comment 6 lijuan men 2019-06-24 07:04:44 UTC
verify the bug

version:
libvirt-5.4.0-1.module+el8.1.0+3304+7eb41d5f.x86_64
qemu-kvm-4.0.0-4.module+el8.1.0+3356+cda7f1ee.x86_64

steps:
1.start a guest with the xml:
...
    <hub type='usb'>
      <address type='usb' bus='0' port='10'/>
    </hub>
...
    <controller type='ccid' index='0'>
      <address type='usb' bus='0' port='10.1'/>
    </controller>
    <smartcard mode='passthrough' type='spicevmc'>
      <address type='ccid' controller='0' slot='0'/>
    </smartcard>

[root@localhost ~]# virsh start test
Domain test started

2.check the xml and the qemu cmd

[root@localhost ~]# virsh dumpxml test
...
 <controller type='ccid' index='0'>
      <alias name='ccid0'/>
      <address type='usb' bus='0' port='10.1'/>
    </controller>
  <smartcard mode='passthrough' type='spicevmc'>
      <alias name='smartcard0'/>
      <address type='ccid' controller='0' slot='0'/>
    </smartcard>
...

[root@localhost ~]# ps -ef | grep test 
...
-device usb-ccid,id=ccid0,bus=usb.0,port=10.1
...
-chardev spicevmc,id=charsmartcard0,name=smartcard 
-device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0
...

Comment 8 errata-xmlrpc 2019-11-06 07:11:37 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.

https://access.redhat.com/errata/RHBA-2019:3723


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