Bug 1590214 - "Failed to reserve port 65535" for guest graphic
Summary: "Failed to reserve port 65535" for guest graphic
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.6
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Pavel Hrdina
QA Contact: yanqzhan@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-12 08:37 UTC by Fangge Jin
Modified: 2018-10-30 09:57 UTC (History)
3 users (show)

Fixed In Version: libvirt-4.5.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 09:56:58 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3113 None None None 2018-10-30 09:57:59 UTC

Description Fangge Jin 2018-06-12 08:37:16 UTC
Description of problem:
Set graphic port to 65535, guest will fail to start.

# virsh dumpxml $guest
    <graphics type='vnc' port='65534' autoport='no' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>

# virsh start $guest
error: Failed to start domain 1
error: internal error: Failed to reserve port 65535

I think if set bitmap->nbits = 65536, or change "bitmap->nbits <= b" to "bitmap->nbits < b", the problem will be gone.

int
virBitmapSetBit(virBitmapPtr bitmap,
                size_t b)
{
    if (bitmap->nbits <= b)
        return -1;

    bitmap->map[VIR_BITMAP_UNIT_OFFSET(b)] |= VIR_BITMAP_BIT(b);
    return 0;
}



Version-Release number of selected component (if applicable):
libvirt-4.3.0-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
65534 can work

Comment 3 Pavel Hrdina 2018-06-14 07:32:26 UTC
Upstream patch posted:

https://www.redhat.com/archives/libvir-list/2018-June/msg01089.html

Comment 4 Pavel Hrdina 2018-06-14 07:58:55 UTC
Upstream commit:

commit 5e828d03bf662331579c24677d29e50b9bc33951
Author: Pavel Hrdina <phrdina@redhat.com>
Date:   Thu Jun 14 09:17:10 2018 +0200

    virtportallocator: Change number of ports to 65536

Comment 6 yanqzhan@redhat.com 2018-08-09 10:46:14 UTC
Verify with:
libvirt-4.5.0-6.el7.x86_64
qemu-kvm-rhev-2.12.0-9.el7.x86_64

Steps to verify:
1. start guest with vnc graphic port='65535':
# virsh start yan-V
Domain yan-V started

# virsh dumpxml yan-V|grep 'graphics t' -A2
    <graphics type='vnc' port='65535' autoport='no' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>

# ps aux|grep qemu|grep vnc
 -vnc 0.0.0.0:59635 

2.define a guest with graphic port='65536', try to start it:
# virsh start yan-V 
error: Failed to start domain yan-V
error: unsupported configuration: vnc port must be in range [5900,65535]

3.retest step2 with port='65537':
same as step 2

Since the test result is as expected. mark this bug as verified.

Comment 8 errata-xmlrpc 2018-10-30 09:56:58 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://access.redhat.com/errata/RHSA-2018:3113


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