Hide Forgot
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.
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.