Bug 760814

Summary: qemu-kvm should examine the spice port already in use
Product: Red Hat Enterprise Linux 5 Reporter: langfang <flang>
Component: kvmAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 5.8CC: cfergeau, chayang, desktop-qa-list, djasa, juzhang, michen, mkenneth, qzhang, rhod, shuang, virt-maint
Target Milestone: beta   
Target Release: 5.8   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-12 21:00:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description langfang 2011-12-07 03:13:25 UTC
Description of problem:
 qemu-kvm should examine the port already in use

Version-Release number of selected component (if applicable):
kernel:2.6.18-300.el5
kvm-83-246.el5


How reproducible:
100%

Steps to Reproduce:
1.boot  guest use the spice port as same as the incoming port

/usr/libexec/qemu-kvm -m 4096 -smp 2,cores=2,threads=1,sockets=2 -name win2008 -usbdevice tablet -rtc-td-hack -uuid 123465d2-2032-848d-bda0-de7adb149048 -boot dc -drive file=/mnt/win2008-64.qcow2,if=virtio,boot=on,bus=0,unit=0,format=qcow2,cache=none,boot=on,werror=stop -net nic,macaddr=54:52:00:23:1f:25,vlan=0,model=virtio -net tap,vlan=0,script=/etc/qemu-ifup -balloon none -monitor stdio -spice host=0,ic=on,port=5911,disable-ticketing -qxl 1  -fda /usr/share/virtio-win/virtio-drivers.vfd -drive file=/mnt/en_windows_server_2008_datacenter_enterprise_standard_sp2_checked_build_x86_dvd_342434.iso,media=cdrom,if=ide -incoming tcp:0:5911
interface_change_notifier: VD_INTERFACE_MIGRATION
migration_notify_register: record=0x9b15350 opaque=(nil) key=spice_mig_ext mstarted=0x3862413b30 mfinished=0x3862415520 mig_recv=0x38624113e0
interface_change_notifier: VD_INTERFACE_QTERM
init_qxl_ram: npages 14357
qxl_init: rom(0x2b1ec3d23000, 0x105041000, 0x2000) ram(0x2b1ebfd23000, 0x101041000, 0x4000000) vram(0x2b1ec3d25000, 0x105043000, 0x1000)
interface_change_notifier: VD_INTERFACE_QXL
red_worker_main: begin
0: qxl_enter_vga_mode
handle_dev_input: attach
create_cairo_context: using cairo canvas
interface_change_notifier: VD_INTERFACE_KEYBOARD
interface_change_notifier: VD_INTERFACE_MOUSE
QEMU 0.9.1 monitor - type 'help' for more information


  
Actual results:
 boot normally

Expected results:
should give a friendly tip for example:
(qemu) Migration failed. Exit code tcp:0:5955(-98), exiting.

Additional info: there have a test on rhel6.2 host
/usr/libexec/qemu-kvm -M rhel6.2.0 -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -name win7sp1-64 -uuid 5d371368-1570-4966-925f-6a58262e7df4 -nodefconfig  -rtc base=localtime,driftfix=slew -no-shutdown -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x4 -drive file=/root/zhangjunyi/win7-64-1125.raw,if=none,id=drive-virtio-disk0,format=raw,serial=32-b475-8f3486219435,cache=none,werror=stop,rerror=stop,aio=threads -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,id=hostnet0,vhost=on -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:1a:4a:42:0b:27,bus=pci.0,addr=0x3 -chardev pty,id=charchannel0,path=/dev/pts/6 -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=kvm -usb -device usb-tablet,id=input0 -vnc :10 -monitor stdio -smbios type=1,manufacturer="Dell Inc.111111",product="Precision T1600",version=0.1,serial=34W753X,uuid=4C4C4544-0034-5710-8037-B3C04F353358,sku="Not Specified",family="Not Specified" -boot menu=on -nodefaults -spice port=5955,disab
le-ticketing -vga qxl -incoming tcp:0:5955
char device redirected to /dev/pts/1
do_spice_init: starting 0.8.3
spice_server_add_interface: SPICE_INTERFACE_MIGRATION
spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
spice_server_add_interface: SPICE_INTERFACE_MOUSE
spice_server_add_interface: SPICE_INTERFACE_QXL
red_worker_main: begin
QEMU 0.12.1 monitor - type 'help' for more information
(qemu) Migration failed. Exit code tcp:0:5955(-98), exiting.

Comment 1 David Jaša 2011-12-07 13:44:53 UTC
It seems similar in nature to bug #682227.

Reassigning to better-fitting componets & assignees.

Comment 2 David Jaša 2011-12-07 16:18:57 UTC
Tried to reproduce on rhel 6, it fails nicely as it should:

$ /usr/libexec/qemu-kvm -incoming tcp:0:1234 -spice port=1234 /dev/zero ; echo "qemu-kvm return code: $?"
do_spice_init: starting 0.8.3
spice_server_add_interface: SPICE_INTERFACE_MIGRATION
spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
spice_server_add_interface: SPICE_INTERFACE_MOUSE
spice_server_add_interface: SPICE_INTERFACE_QXL
red_worker_main: begin
Migration failed. Exit code tcp:0:1234(-98), exiting.
qemu-kvm return code: 158

Note for Virt QE: the reproducer on 5.x can be simplified to this universal command line so you don't have to re-create reporter's setup:

/usr/libexec/qemu-kvm -nographic -incoming tcp:0:1234 -spice port=1234 /dev/zero