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 958929 - Wrong order of usb controller and usb ccid in qemu cli after migration.
Summary: Wrong order of usb controller and usb ccid in qemu cli after migration.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 870003
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-02 17:16 UTC by Marian Krcmarik
Modified: 2013-12-04 10:26 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-04 10:26:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Marian Krcmarik 2013-05-02 17:16:43 UTC
Description of problem:
If a VM is started with smartcard ccid device emulated based on following element:
<smartcard mode='passthrough' type='spicevmc'>
    <address type='ccid' controller='0' slot='0'/>
</smartcard>
qemu is started with following options:
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device usb-ccid,id=ccid0

However once the VM is migrated, the destination qemu process is followid with options in this order:
-device usb-ccid,id=ccid0 -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
which ends up with following error:
qemu-kvm: -device usb-ccid,id=ccid0: No 'USB' bus found for device 'usb-ccid'

Version-Release number of selected component (if applicable):
libvirt-0.10.2-18.el6_4.2.x86_64

How reproducible:
always

Steps to Reproduce:
1. Get a VM with smartcard support (Add element <smartcard>)
2. Migrate VM to another host.

Actual results:
Destination qemu process fails with:
qemu-kvm: -device usb-ccid,id=ccid0: No 'USB' bus found for device 'usb-ccid'

Expected results:
USB host controller is defined earlier so usb-ccid emulation can see the controller.

Additional info:
I've tested within RHEVM3.2 Beta and Rhel6.4 Hosts and I assume this is libvirt domain.

Comment 2 Marian Krcmarik 2013-05-10 13:27:26 UTC
Note: Do not define native usb redir to be used (usb controller ich9-ehci and ich9-uhci models) when reproducing the bug since it works.

Comment 3 Peter Krempa 2013-05-29 12:17:31 UTC
This issue is already fixed upstream:

commit 0f720ab35a1a836aa23b66ef4bafbc5e57290357
Author: Michal Privoznik <mprivozn>
Date:   Mon Nov 5 11:51:44 2012 +0100

    qemu: Add controllers in specified order
    
    qemu is sensitive to the order of arguments passed. Hence, if a
    device requires a controller, the controller cmd string must
    precede device cmd string. The same apply for controllers, when
    for instance ccid controller requires usb controller. So
    controllers create partial ordering in which they should be added
    to qemu cmd line.


Moving to POST.

Comment 4 Jiri Denemark 2013-06-05 11:59:42 UTC
This bug is in fact a duplicate of bug 870003. However, let's keep this bug open as TestOnly as the situation in which it was observed is quite different.

Comment 5 CongDong 2013-06-05 12:01:55 UTC
I can reproduce this bug.

libvirt-0.10.2-18.el6_4.6.x86_64

steps:
1. Install a guest with smartcard.
# virsh dumpxml rhel-test
...
    <smartcard mode='passthrough' type='spicevmc'>
      <alias name='smartcard0'/>
      <address type='ccid' controller='0' slot='0'/>
    </smartcard>
...
# ps -ef | grep qemu | grep rhel-test
qemu     27856     1 98 19:54 ?        00:04:00 /usr/libexec/qemu-kvm -name rhel-test -S -M rhel6.4.0 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -uuid f706090f-31bf-4386-a8b3-87d5426d35a3 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/rhel-test.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4 -device usb-ccid,id=ccid0 -drive file=/var/lib/libvirt/images/test/mt.img,if=none,id=drive-ide0-0-0,format=raw,cache=none -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -netdev tap,fd=23,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:c1:84:d0,bus=pci.0,addr=0x3 -chardev spicevmc,id=charsmartcard0,name=smartcard -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -spice port=5902,addr=127.0.0.1,disable-ticketing,seamless-migration=on -vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=67108864 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5

2.  Migrate VM to another host

3. An error message popup:

Unable to migrate guest: internal error Process exited while reading console log output: char device redirected to /dev/pts/7
qemu-kvm: -device usb-ccid,id=ccid0: No 'USB' bus found for device 'usb-ccid'


Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 44, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/migrate.py", line 556, in _async_migrate
    vm.migrate(dstconn, migrate_uri, rate, live, secure, meter=meter)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1141, in migrate
    self._backend.migrate(destconn.vmm, flags, newname, interface, rate)
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 966, in migrate
    if ret is None:raise libvirtError('virDomainMigrate() failed', dom=self)
libvirtError: internal error Process exited while reading console log output: char device redirected to /dev/pts/7
qemu-kvm: -device usb-ccid,id=ccid0: No 'USB' bus found for device 'usb-ccid'

Comment 6 dyuan 2013-06-06 02:38:14 UTC
(In reply to Jiri Denemark from comment #4)
> This bug is in fact a duplicate of bug 870003. However, let's keep this bug
> open as TestOnly as the situation in which it was observed is quite
> different.

QE will re-test it when the bug 870003 fixed, thanks for your comment.

Comment 10 CongDong 2013-08-27 11:40:43 UTC
I can produce this bug with libvirt-0.10.2-18.el6_4.6.x86_64, steps and results are same with comment 5.

Verify with libvirt-0.10.2-23.el6.x86_64

Steps:
1.  On the source machine:
# virsh dumpxml dc-test| grep -A3 -B3 smart
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <smartcard mode='passthrough' type='spicevmc'>
      <alias name='smartcard0'/>
      <address type='ccid' controller='0' slot='0'/>
    </smartcard>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target port='0'/>

# ps -ef | grep dc-test
qemu     21364     1  9 07:35 ?        00:00:06 /usr/libexec/qemu-kvm -name dc-test -S -M rhel6.5.0 -enable-kvm -m 1024 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 874c62f7-8fcc-2d82-1e74-e6fcb32b7b77 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/dc-test.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device usb-ccid,id=ccid0 -drive file=/var/lib/libvirt/images/dcnfs/rhel6.4-1.img,if=none,id=drive-ide0-0-0,format=qcow2,cache=none -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -netdev tap,fd=31,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:e7:5e:72,bus=pci.0,addr=0x3 -chardev spicevmc,id=charsmartcard0,name=smartcard -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -spice port=5901,addr=127.0.0.1,disable-ticketing,seamless-migration=on -vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=67108864 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -incoming tcp:[::]:49152 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5


2.Migrate VM to client machine.

Result:
No error message.

Check the guest on client machine:
# ps -ef | grep dc-test
qemu      9163     1  8 19:30 ?        00:00:13 /usr/libexec/qemu-kvm -name dc-test -S -M rhel6.5.0 -enable-kvm -m 1024 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 874c62f7-8fcc-2d82-1e74-e6fcb32b7b77 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/dc-test.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device usb-ccid,id=ccid0 -drive file=/var/lib/libvirt/images/dcnfs/rhel6.4-1.img,if=none,id=drive-ide0-0-0,format=qcow2,cache=none -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -netdev tap,fd=31,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:e7:5e:72,bus=pci.0,addr=0x3 -chardev spicevmc,id=charsmartcard0,name=smartcard -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -spice port=5902,addr=127.0.0.1,disable-ticketing,seamless-migration=on -vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=67108864 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -incoming tcp:[::]:49152 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5

# virsh dumpxml dc-test| grep -A3 -B3 smart
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <smartcard mode='passthrough' type='spicevmc'>
      <alias name='smartcard0'/>
      <address type='ccid' controller='0' slot='0'/>
    </smartcard>
    <serial type='pty'>
      <source path='/dev/pts/4'/>
      <target port='0'/>


As the result, set VERIFIED.

Comment 11 Dave.sr21 2013-09-09 03:42:43 UTC
Is this fixed or is there a resolution for this?

My VMs are not starting due to this...

Comment 12 Dave.sr21 2013-09-09 06:16:59 UTC
Just removed the binary file containing the VM data from /var/lib/libvirt/qemu/save/    and the VM came up, sans smartcard ccid device. Hope this helps.

Comment 13 Jiri Denemark 2013-12-04 10:26:18 UTC
TestOnly bug for 6.5


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