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 1368077 - misleading error with "host"/"host-certificates" smartcard
Summary: misleading error with "host"/"host-certificates" smartcard
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Yanqiu Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-18 10:08 UTC by Yanqiu Zhang
Modified: 2018-06-07 13:30 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-06-07 13:30:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Yanqiu Zhang 2016-08-18 10:08:55 UTC
Description of problem:
Problems when start domain with "host"/"host-certificates" smartcard.

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.6.0-21.el7.x86_64
libvirt-2.0.0-5.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a domain with "host-certificates" and slot=1 in xml
# virsh edit test1
    <smartcard mode='host-certificates'>
      <certificate>cert1</certificate>
      <certificate>cert2</certificate>
      <certificate>cert3</certificate>
      <database>/etc/pki/nssdb/</database>
      <address type='ccid' controller='0' slot='1'/>
    </smartcard>

2. Start the domain
error: Failed to start domain test1
error: unsupported configuration: this QEMU binary lacks multiple smartcard support
(this error is not appropriate, and also exists when use other model type smartcard, such as "passthrough")

3. Edit the slot to be "0" in xml:
# virsh edit test1
    <smartcard mode='host-certificates'>
......
      <address type='ccid' controller='0' slot='0'/>
    </smartcard>

4. Start the domain again:
# virsh start test1
error: Failed to start domain test1
error: internal error: process exited while connecting to monitor: 2016-08-18T06:57:21.372800Z qemu-kvm: -device ccid-card-emulated,backend=certificates,cert1=cert1,cert2=cert2,cert3=cert3,db=/etc/pki/nssdb/,id=smartcard0,bus=ccid0.0: Parameter 'driver' expects pluggable device type

5.Edit the domain xml with "host" smartcard and slot=0 in xml
    <smartcard mode='host'>
      <address type='ccid' controller='0' slot='0'/>
    </smartcard>

6.Start the domain:
# virsh start test1
error: Failed to start domain test1
error: internal error: qemu unexpectedly closed the monitor: 2016-08-18T07:55:17.789920Z qemu-kvm: -device ccid-card-emulated,backend=nss-emulated,id=smartcard0,bus=ccid0.0: Parameter 'driver' expects pluggable device type

7. check related .c file:
 # vim /usr/src/debug/qemu-2.6.0/hw/usb/ccid-card-emulated.c
static void emulated_class_initfn(ObjectClass *klass, void *data)
{
    DeviceClass *dc = DEVICE_CLASS(klass);
    CCIDCardClass *cc = CCID_CARD_CLASS(klass);
    cc->initfn = emulated_initfn;
    cc->exitfn = emulated_exitfn;
    cc->get_atr = emulated_get_atr;
    cc->apdu_from_guest = emulated_apdu_from_guest;
    set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
    dc->desc = "emulated smartcard";
    dc->props = emulated_card_properties;
    /* Disabled for Red Hat Enterprise Linux: */
    dc->cannot_instantiate_with_device_add_yet = true;
}    
(find that this function is disabled by qemu)

8. Check qom-type-list:
There is "ccid-card-emulated" exists.

Actual results:
As step 2, 4, 6 descripted.
According to step 7, 8, it looks like a problem since qemu lied to libvirt, and libvirt still think qemu-kvm support it.

Expected results:
1.In step 2, a more appropriate error should be given, since user only used 1 smartcard,  should give error about wrong slot assignment.
2.About step 4,6,7,8  since qemu disabled start domain with "host-certificates" smartcard,  and libvirt can still find ccid-card-emulated device, this confict must be resolved, or a specific statement about "unsupported smartcard model" may be given.

Additional info:
1.Can start domain with  <smartcard mode='passthrough' type='spicevmc'/> and slot=0.

Comment 2 Ján Tomko 2018-06-07 13:30:21 UTC
ccid-card-emulated has been disabled in RHEL for a while now and this bug has been open for almost two years with nobody else complaining.


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