RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1364843 - libvirt should not reserve the port setting in the xml when vnc_auto_unix_socket takes effect
Summary: libvirt should not reserve the port setting in the xml when vnc_auto_unix_soc...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Pavel Hrdina
QA Contact: Fangge Jin
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-08 02:55 UTC by yafu
Modified: 2017-08-01 23:53 UTC (History)
5 users (show)

Fixed In Version: libvirt-2.5.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 17:11:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1846 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2017-08-01 18:02:50 UTC

Description yafu 2016-08-08 02:55:26 UTC
Description of the problem:
libvirt reserve the port setting in the guest xml when vnc_auto_unix_socket takes effect, it will make migration failed when the target host has the same port used by another guest.

How producible
100%

Version:
libvirt-2.0.0-4.el7.x86_64

Steps to reproduce:
1.Enable vnc_auto_unix_socket in the qemu.conf and restart libvirtd service:
  #cat /etc/libvirt/qemu.conf
   ...
   vnc_auto_unix_socket=1
   ...

  #systemctl restart libvirtd.service

2.Start a guest with vnc setting as follows:
  #virsh edit mig1
   ...
     <graphics type='vnc' port='5900' autoport='no'>
      <listen type='address'/>
    </graphics>
    ...

3.The live xml of guest mig1:
  #virsh dumpxml mig1
   ...
    <graphics type='vnc' socket='/var/lib/libvirt/qemu/domain-572-mig1/vnc.sock'>
      <listen type='socket' socket='/var/lib/libvirt/qemu/domain-572-mig1/vnc.sock'/>
    </graphics>
   ...

4. Check the port usage on the host, find that 5900 is not used:
  #netstat -tunlp

5.Start another guest mig2 with vnc setting as step2:
  #virsh start mig2
  error: Failed to start domain mig2
  error: internal error: Failed to reserve port 5900


Actual results:
libvirt reserve port for the guest even the vnc_auto_unix_socket take effect and the guest using socket listen type.

Expected results:
libvirt should not reserve port when the vnc_auto_unix_socket take effect.

Additional info:
1.It will make migration failed when the target host has the same port used by another guest.

Comment 2 Pavel Hrdina 2016-08-18 08:43:51 UTC
Upstream commit:

commit f0551b9bc4ec1c379c72dbf3f1ea7daa80b18ba9
Author: Pavel Hrdina <phrdina>
Date:   Sat Aug 13 21:29:38 2016 +0200

    qemu_process: graphics: setup listen types before ports are reserved/allocated

Comment 5 Fangge Jin 2017-03-13 03:00:18 UTC
Reproduce this bug on build libvirt-2.0.0-10.el7.x86_64

Verify PASS on build libvirt-3.1.0-2.el7.x86_64.

Steps are same as description, the second guest can start up successfully.

Comment 6 errata-xmlrpc 2017-08-01 17:11:42 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/RHEA-2017:1846

Comment 7 errata-xmlrpc 2017-08-01 23:53:19 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/RHEA-2017:1846


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