Bug 769144 - The parameter "to=<port>" of vnc works bad
The parameter "to=<port>" of vnc works bad
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
x86_64 Linux
low Severity low
: rc
: 7.0
Assigned To: Gerd Hoffmann
Virtualization Bugs
Depends On:
  Show dependency treegraph
Reported: 2011-12-19 22:51 EST by Sibiao Luo
Modified: 2013-12-12 03:19 EST (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-12-12 03:19:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Sibiao Luo 2011-12-19 22:51:32 EST
Description of problem:
The command line parameter value of "to=<port>" should specify the display range and the qemu will try to find a free one, The parameter "to=<port>" of vnc works bad when all the ports were in used.

Version-Release number of selected component (if applicable):
Server info:

Client info:

How reproducible:

Steps to Reproduce:
1. specified the display range in host A.
eg. ...-vnc :1,to=2 
2. take all the display number in used in host A.
eg. # /usr/libexec/qemu-kvm -vnc :1
    # /usr/libexec/qemu-kvm -vnc :2
3. start a guest  with the CLI of the step 1.
4. 'info vnc' in monitor shows the display actually used.
(qemu) info vnc
        auth: none

Actual results:
the port number 5903 can be used.

Expected results:
the available port should be 5901,5902. for 5903 port, can not be used.

Additional info:
Comment 2 Gerd Hoffmann 2012-01-04 07:05:53 EST
Simple off-by-one bug, qemu stops checking at 5903 instead of 5902.
Comment 3 Ademar Reis 2012-03-22 13:49:00 EDT
Simple bug, but low impact, apparently not even triggered by libvirt standard usage. Moving to 6.4.
Comment 8 Gerd Hoffmann 2013-12-11 11:48:04 EST
Please retest with latest qemu-kvm.
Comment 9 juzhang 2013-12-11 21:22:53 EST
Hi Sluo,

Could you have a try then update the result in the bz?

Best Regards,
Comment 10 Sibiao Luo 2013-12-11 21:46:40 EST
(In reply to Gerd Hoffmann from comment #8)
> Please retest with latest qemu-kvm.
The rhel7.0 latest qemu-kvm did not hit this issue any more.
# /usr/libexec/qemu-kvm -vnc :1 &
# /usr/libexec/qemu-kvm -vnc :2 &
# /usr/libexec/qemu-kvm -vnc :1,to=2 -monitor stdio
QEMU 1.5.3 monitor - type 'help' for more information
(qemu) qemu-kvm: Failed to start VNC server on `:1,to=2': Failed to bind socket: Address already in use

host info:
# uname -r && rpm -q qemu-kvm-rhev && rpm -q seabios

Also tried the rhel6.5 host also not hit it any more.
# /usr/libexec/qemu-kvm -vnc :2 &
[1] 18092
# /usr/libexec/qemu-kvm -vnc :3 &
[2] 18098
# /usr/libexec/qemu-kvm -vnc :2,to=3 -monitor stdio
qemu-kvm: Failed to start VNC server on `:2,to=3': socket bind failed: Address already in use
host info:
# uname -r && rpm -q qemu-kvm-rhev

Best Regards,
Comment 11 Gerd Hoffmann 2013-12-12 03:19:31 EST
Good.  chardev hotplug backport also brought in some socket code patches, they probably fixed this one as side effect in rhel6.

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