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 1558317 - VM can not start when configuring alias for ccid controller
Summary: VM can not start when configuring alias for ccid controller
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.5
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Jing Qi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-20 02:42 UTC by jiyan
Modified: 2018-10-30 09:55 UTC (History)
7 users (show)

Fixed In Version: libvirt-4.3.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 09:53:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3113 0 None None None 2018-10-30 09:55:20 UTC

Description jiyan 2018-03-20 02:42:46 UTC
Description of problem:
VM can not start  when configuring alias for ccid controller

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.10.0-21.el7_5.1.x86_64
kernel-3.10.0-861.el7.x86_64
libvirt-3.9.0-14.el7_5.1.x86_64

How reproducible:
100%

Steps to Reproduce:
S1: VM can start with no alias configured for ccid controller
# virsh domstate test1
shut off

# virsh dumpxml test1 |grep "<smart" -A2
    <smartcard mode='passthrough' type='spicevmc'>
      <address type='ccid' controller='0' slot='0'/>
    </smartcard>

# virsh dumpxml test1 |grep "<controller type='ccid'" -A2
    <controller type='ccid' index='0'>
      <address type='usb' bus='0' port='3'/>
    </controller>

# virsh start test1
Domain test1 started

# ps -ef |grep test1 |grep ccid
-device usb-ccid,id=ccid0,bus=ua-usb6.0,port=3
-chardev spicevmc,id=charsmartcard0,name=smartcard 
-device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0

S2: VM can not start when configuring alias for ccid controller
# virsh domstate test1
shut off

# virsh dumpxml test1 |grep "<smart" -A2
    <smartcard mode='passthrough' type='spicevmc'>
      <address type='ccid' controller='0' slot='0'/>
    </smartcard>
[root@amd-5200-4-1 test]# virsh dumpxml test1 |grep "<controller type='ccid'" -A3
    <controller type='ccid' index='0'>
      <alias name='ua-ccid'/>
      <address type='usb' bus='0' port='3'/>
    </controller>

# virsh start test1
error: Failed to start domain test1
error: internal error: qemu unexpectedly closed the monitor: 2018-03-20T02:32:47.269146Z qemu-kvm: -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0: Bus 'ccid0.0' not found

Actual results:
As S2 shows

Expected results:
As S1 shows

Additional info:

Comment 2 Michal Privoznik 2018-03-23 13:29:03 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2018-March/msg01472.html

Comment 3 Michal Privoznik 2018-03-23 14:59:14 UTC
I've just pushed the patch upstream:

commit 42900ec62214c67ab414c55f6f7ac4da0a21d81b
Author:     Michal Privoznik <mprivozn>
AuthorDate: Fri Mar 23 14:24:14 2018 +0100
Commit:     Michal Privoznik <mprivozn>
CommitDate: Fri Mar 23 15:57:06 2018 +0100

    qemu: Build smartcard command line more wisely
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1558317
    
    Similarly to b133fac356324c3 we need to look up alias of CCID
    controller when constructing smartcard command line instead of
    relying on broken assumption it will always be 'ccid0'. After
    user aliases it can be anything.
    
    Signed-off-by: Michal Privoznik <mprivozn>
    Reviewed-by: Andrea Bolognani <abologna>

v4.1.0-288-g42900ec622

Comment 5 Jing Qi 2018-07-17 02:09:48 UTC
Verified with libvirt-4.5.0-3.el7.x86_64 and passed.

<controller type='ccid' index='0'>
      <alias name='ua-c80aba6e-b6d8-448b-ab6e-8c7b5c29f353'/>
      <address type='usb' bus='0' port='1'/>
    </controller>
 <smartcard mode='passthrough' type='spicevmc'>
      <address type='ccid' controller='0' slot='0'/>
    </smartcard>

# virsh start avocado-vt-vm-numa0
Domain avocado-vt-vm-numa0 started

Comment 7 errata-xmlrpc 2018-10-30 09:53:14 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/RHSA-2018:3113


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