Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
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


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1846 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@redhat.com>
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.