Bug 1591645
Summary: | Spice port 65536 is converted to 0 | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Fangge Jin <fjin> | ||||
Component: | libvirt | Assignee: | Ján Tomko <jtomko> | ||||
Status: | CLOSED ERRATA | QA Contact: | Yanqiu Zhang <yanqzhan> | ||||
Severity: | low | Docs Contact: | |||||
Priority: | low | ||||||
Version: | 8.0 | CC: | jdenemar, jsuchane, lmen, xuzhang, yafu, yanqzhan | ||||
Target Milestone: | rc | Keywords: | Automation, Regression, Upstream | ||||
Target Release: | 8.0 | ||||||
Hardware: | x86_64 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | libvirt-5.3.0-1.el8 | Doc Type: | If docs needed, set a value | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2019-11-06 07:11:37 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Fangge Jin
2018-06-15 08:16:32 UTC
Current git version of libvirt no longer shows the incorrect error message, fixed by: commit 5e828d03bf662331579c24677d29e50b9bc33951 Author: Pavel Hrdina <phrdina> AuthorDate: 2018-06-14 09:17:10 +0200 Commit: Pavel Hrdina <phrdina> CommitDate: 2018-06-14 09:52:21 +0200 virtportallocator: Change number of ports to 65536 USHRT_MAX is not good enough because the value is 65535 which specifies the number of bits in bitmap. The allowed port range is 0-65535 so we need to increase the number. We could have USHRT_MAX + 1 but let's define the number explicitly. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1590214 Reviewed-by: Ján Tomko <jtomko> Signed-off-by: Pavel Hrdina <phrdina> git describe: v4.4.0-247-g5e828d03bf contains: v4.5.0-rc1~115 Issue still exists: libvirt-4.5.0-6.el7.x86_64 qemu-kvm-rhev-2.12.0-9.el7.x86_64 Description: Spice port 65536 is converted to 0 unless after a fresh libvirtd restart Steps: 1.Define a guest with spice graphic port='65536': <graphics type='spice' port='65536' autoport='no'/> 2.Try to start the guest: # virsh start yan-V error: Failed to start domain yan-V error: internal error: Failed to reserve port 0 3.Restart libvirtd and try to start the guest again and again: # systemctl restart libvirtd # virsh start yan-V error: Failed to start domain yan-V error: internal error: qemu unexpectedly closed the monitor: 2018-08-09T11:10:33.509086Z qemu-kvm: spice port is out of range # virsh start yan-V error: Failed to start domain yan-V error: internal error: Failed to reserve port 0 # virsh start yan-V error: Failed to start domain yan-V error: internal error: Failed to reserve port 0 ... Actual results: Guest starts failed, always get error "Failed to reserve port 0", except restart a fresh libvirtd, the error "spice port is out of range" will show once. More details pls refer to "reproduce-logs" in attachment. Created attachment 1474654 [details]
reproduce-logs_comment5
commit c2a8256991d772323a3df08c33b012bf12d62645 Author: Ján Tomko <jtomko> CommitDate: 2019-01-25 14:50:05 +0100 virPortAllocatorSetUsed: ignore port 0 Similar to what commit 86dba8f3 did for virPortAllocatorRelease, ignore port 0 in virPortAllocatorSetUsed. For all the reasonable use cases the callers already check that the port is non-zero, however if the port from the XML overflows unsigned short and turns into 0, it can be set as used by virPortAllocatorSetUsed but not released by virPortAllocatorRelease. Also skip port '0' in virPortAllocatorSetUsed to make this behavior symmetric. The serenity was disturbed by commit 5dbda5e9 which started using virPortAllocatorRelease instead of virPortAllocatorSetUsed (false). https://bugzilla.redhat.com/show_bug.cgi?id=1591645 Signed-off-by: Ján Tomko <jtomko> Reviewed-by: Cole Robinson <crobinso> git describe: v5.0.0-109-gc2a8256991 Verify this bug with: libvirt-daemon-5.5.0-2.module+el8.1.0+3773+7dd501bf.x86_64 qemu-kvm-4.0.0-6.module+el8.1.0+3736+a2aefea3.x86_64 Steps: Scenario 1: spice port testing 1. <graphics type='spice' port='65536' autoport='no'> <listen type='address'/> </graphics> # virsh start avocado-vt-vm1 error: Failed to start domain avocado-vt-vm1 error: internal error: process exited while connecting to monitor: 2019-07-31T10:48:45.888568Z qemu-kvm: spice port is out of range # systemctl restart libvirtd # virsh start avocado-vt-vm1 error: Failed to start domain avocado-vt-vm1 error: internal error: process exited while connecting to monitor: 2019-07-31T10:49:04.275179Z qemu-kvm: spice port is out of range 2. <graphics type='spice' port='0' autoport='no'/> # virsh dumpxml avocado-vt-vm1 --inactive |grep graphic -1 <graphics type='spice'> <listen type='none'/> </graphics> # virsh start avocado-vt-vm1 Domain avocado-vt-vm1 started # virsh dumpxml avocado-vt-vm1 |grep graphic -1 <graphics type='spice'> <listen type='none'/> </graphics> 3. <graphics type='spice' port='65535' autoport='no'> <listen type='address'/> </graphics> # virsh start avocado-vt-vm1 Domain avocado-vt-vm1 started # virsh dumpxml avocado-vt-vm1 |grep graphic -1 </input> <graphics type='spice' port='65535' autoport='no' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> </graphics> 4. <graphics type='spice' port='-1' autoport='no'> <listen type='address'/> </graphics> # virsh start avocado-vt-vm1 Domain avocado-vt-vm1 started # virsh dumpxml avocado-vt-vm1 |grep graphic -1 <graphics type='spice' port='5900' autoport='no' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> </graphics> <video> 5. <graphics type='spice' port='5902' autoport='no'> <listen type='address'/> </graphics> # virsh start avocado-vt-vm1 Domain avocado-vt-vm1 started # virsh dumpxml avocado-vt-vm1 |grep graphic -1 <graphics type='spice' port='5902' autoport='no' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> </graphics> Scenario 2: spice tls-port testing 1. <graphics type='spice' port='5901' tlsPort='65536' autoport='no'> <listen type='address'/> </graphics> # vim /etc/libvirt/qemu.conf spice_tls = 1 # systemctl restart libvirtd # virsh start avocado-vt-vm1 error: Failed to start domain avocado-vt-vm1 error: internal error: process exited while connecting to monitor: 2019-07-31T11:10:51.170585Z qemu-kvm: spice tls-port is out of range 2. <graphics type='spice' port='5901' tlsPort='0' autoport='no'/> # virsh dumpxml avocado-vt-vm1 |grep graphic -1 <graphics type='spice' port='5901' autoport='no'> <listen type='address'/> </graphics> # virsh start avocado-vt-vm1 Domain avocado-vt-vm1 started # virsh dumpxml avocado-vt-vm1 |grep graphic -1 <graphics type='spice' port='5901' autoport='no' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> </graphics> 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/RHBA-2019:3723 |