Bug 682227

Summary: qemu-kvm doesn't exit when binding to specified port fails
Product: Red Hat Enterprise Linux 6 Reporter: David Jaša <djasa>
Component: qemu-kvmAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: medium    
Version: 6.1CC: drjones, flang, gcosta, gspurgeon, juzhang, mkenneth, qzhang, tburke, virt-maint, xwei
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.182.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 15:44:56 UTC Type: ---
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:    
Bug Blocks: 580953, 649196    

Description David Jaša 2011-03-04 14:22:51 UTC
Description of problem:
Qemu-kvm doesn't exit with error when it is told to run spice server on already-occupied port. 

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.148.el6.x86_64
spice-server-0.7.3-2.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. run one qemu-kvm with parameter -spice port=3000
2. run another qemu-kvm with parameter -spice port=3000
  
Actual results:
second qemu-kvm should exit with error

Expected results:
qemu-kvm continues running and starts VM

Additional info: 
qemu-kvm CLI output:

do_spice_init: starting 0.7.3
reds_init_socket: reds_init_socket: binding socket to :3000 failed

spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
spice_server_add_interface: SPICE_INTERFACE_MOUSE
Using CPU model "cpu64-rhel6"
Using CPU model "cpu64-rhel6"
spice_server_add_interface: SPICE_INTERFACE_QXL
red_worker_main: begin
spice_server_add_interface: SPICE_INTERFACE_RECORD
spice_server_add_interface: SPICE_INTERFACE_PLAYBACK
handle_dev_destroy_surfaces: 
handle_dev_input: start
handle_dev_destroy_surfaces: 
handle_dev_destroy_surfaces: 
handle_dev_input: oom current 18 pipe 0
^C

Comment 4 Gerd Hoffmann 2011-06-06 06:35:11 UTC
devel-acked

Comment 5 juzhang 2011-06-14 12:56:01 UTC
Reproduced with qemu-kvm-0.12.1.2-2.163.el6.x86_64, marked qa_ack+

guest 1
spice port=5930,disable-ticketing -vga qxl

guest 2
spice port=5930,disable-ticketing -vga qxl

Results:
reds_init_socket: reds_init_socket: binding socket to :5930 failed.

Comment 6 Gerd Hoffmann 2011-07-20 13:32:37 UTC
fix committed upstream, backport posted.

Comment 10 Qunfang Zhang 2011-08-26 05:08:54 UTC
Verified on qemu-kvm-0.12.1.2-2.184.el6, passed.

1. Boot guest A on host with -spice port=5930,disable-ticketing -vga qxl -global qxl-vga.vram_size=67108864

do_spice_init: starting 0.8.2
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) 

2. Boot guest B on the same host still with -spice port=5930,disable-ticketing -vga qxl -global qxl-vga.vram_size=67108864

do_spice_init: starting 0.8.2
reds_init_socket: reds_init_socket: binding socket to :5930 failed
failed to initialize spice server
[root@localhost mnt]# 

So, this issue is fixed.

Comment 12 Alon Levy 2011-09-20 08:56:50 UTC
*** Bug 602153 has been marked as a duplicate of this bug. ***

Comment 13 Xiaoqing Wei 2011-11-16 06:45:29 UTC
Hi, 

This bug  exists on 6.1.z too, 
qemu-kvm-0.12.1.2-2.160.el6_1.9.x86_64

any plan to fix it on rhel6.1.z ?

Sincerely,
Xiaoqing Wei.

Comment 14 Gerd Hoffmann 2011-11-16 09:01:09 UTC
Minor issue, no plans to fix this in 6.1.z.

Comment 15 errata-xmlrpc 2011-12-06 15:44:56 UTC
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.

http://rhn.redhat.com/errata/RHSA-2011-1531.html