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 ---
Upstream patches: https://www.redhat.com/archives/libvir-list/2019-January/msg00498.html
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
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 ...
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