Bug 958929
| Summary: | Wrong order of usb controller and usb ccid in qemu cli after migration. | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Marian Krcmarik <mkrcmari> |
| Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.4 | CC: | acathrow, codong, cwei, Dave.sr21, dyuan, jdenemar, lnovich, mzhan, weizhan, zpeng |
| Target Milestone: | rc | Keywords: | TestOnly |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-12-04 10:26:18 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 870003 | ||
| Bug Blocks: | |||
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. 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.
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. 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'
(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. 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. Is this fixed or is there a resolution for this? My VMs are not starting due to this... 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. TestOnly bug for 6.5 |
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.