Bug 733600

Summary: qemu-kvm doesn't report error when supplied negative vnc port value
Product: Red Hat Enterprise Linux 7 Reporter: langfang <flang>
Component: qemu-kvm-rhevAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 7.0CC: areis, huding, juzhang, knoel, mazhang, michen, mkenneth, qzhang, tburke, virt-maint
Target Milestone: rc   
Target Release: 7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu 2.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 09:41:02 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:

Description langfang 2011-08-26 08:03:07 UTC
Description of problem:
(1)qemu-kvm doesn't show any error when user supplies a negative port value to
-vnc
(2)

Version-Release number of selected component (if applicable):
#rpm -q qemu-kvm 
qemu-kvm-0.12.1.2-2.184.el6.x86_64
#uname -r
2.6.32-191.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. /usr/libexec/qemu-kvm .... -vnc :-123 or "-vnc :1023131"
 
Actual results:
QEMU 0.12.1 monitor - type 'help' for more information
(qemu) 
for the "-vnc :1023131", we can boot the command line, but can not view the guest via VNC.

Expected results:
Qemu-kvm should give user a error tip:"vnc port is  out of range"

Additional info:

Comment 1 langfang 2011-08-26 09:01:35 UTC
Description of problem:
scenario 1) qemu-kvm doesn't show any error when user supplies a negative port value to -vnc
scenario 2) qemu-kvm doesn't show any error when user supplies a out of range port value to -vnc

Actual results:
scenario 1)for the "-vnc :-123",we can boot the command line,and can view the guest via VNC.
scenario 2)for the "-vnc :1023131",we can boot the command line,but can not view the guest via VNC.

Comment 7 Hai Huang 2013-10-22 16:29:21 UTC
*** Bug 1020611 has been marked as a duplicate of this bug. ***

Comment 8 Ronen Hod 2013-10-30 09:48:25 UTC
Not urgent, will be fixed upstream.

Comment 9 Gerd Hoffmann 2013-12-11 12:01:46 UTC
http://patchwork.ozlabs.org/patch/300022/

Comment 13 huiqingding 2014-08-04 05:09:14 UTC
Reproduce this bug using the following version:
qemu-kvm-1.5.3-66.el7.x86_64
kernel-3.10.0-140.el7.x86_64

Steps to Reproduce:
1. boot vm with "-vnc :-123"
# /usr/libexec/qemu-kvm -vnc :-123 -monitor stdio
2. boot vm with "-vnc :1023131"
# /usr/libexec/qemu-kvm -vnc :1023131 -monitor stdio

Results:
after step1 and step2, qemu-kvm doesn't quit.

Comment 14 huiqingding 2014-08-04 05:11:41 UTC
Test this bug using the following version on an intel host:
qemu-kvm-rhev-2.1.0-3.el7ev.preview.x86_64
kernel-3.10.0-140.el7.x86_64

Steps to Test:
1. boot vm with "-vnc :-123"
# /usr/libexec/qemu-kvm -vnc :-123 -monitor stdio
2. boot vm with "-vnc :1023131"
# /usr/libexec/qemu-kvm -vnc :1023131 -monitor stdio

Results:
after step1, qemu-kvm quits with the error info:
(qemu) qemu-kvm: Failed to start VNC server on `:-123': can't convert to a number: -123

after step2, qemu-kvm quits with the error info:
(qemu) qemu-kvm: Failed to start VNC server on `:1023131': port 1023131 out of range

Comment 15 huiqingding 2014-08-04 05:12:15 UTC
Test this bug using the following version on an amd host:
qemu-kvm-rhev-2.1.0-3.el7ev.preview.x86_64
kernel-3.10.0-140.el7.x86_64

Steps to Test:
1. boot vm with "-vnc :-123"
# /usr/libexec/qemu-kvm -vnc :-123 -monitor stdio
2. boot vm with "-vnc :1023131"
# /usr/libexec/qemu-kvm -vnc :1023131 -monitor stdio

Results:
after step1, qemu-kvm quits with the error info:
(qemu) qemu-kvm: Failed to start VNC server on `:-123': can't convert to a number: -123

after step2, qemu-kvm quits with the error info:
(qemu) qemu-kvm: Failed to start VNC server on `:1023131': port 1023131 out of range

Comment 17 langfang 2014-08-25 09:28:41 UTC
Test this bug on latest version:
Host:
# uname -r
3.10.0-144.el7.x86_64
#rpm -q qemu-kvm-rhev
qemu-kvm-rhev-2.1.0-2.el7.x86_64

Steps:
1.Boot guest with

-vnc :111aaaaa/-vnc :-888/-vnc :aaaasss /

Results:
QEMU 2.1.0 monitor - type 'help' for more information
(qemu) qemu-kvm: Failed to start VNC server on `:aaaasss': can't convert to a number: aaaasss


Addtional info:
 -vnc :22222222 -monitor stdio
QEMU 2.1.0 monitor - type 'help' for more information
(qemu) qemu-kvm: Failed to start VNC server on `:22222222': port 22222222 out of range


According to above test ,this bug fixed

Comment 20 errata-xmlrpc 2015-03-05 09:41:02 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.

https://rhn.redhat.com/errata/RHSA-2015-0624.html