Change in vdsm[master]: vdsm-restore-net-config: use existing means to disable IPv6 ...

osvoboda at redhat.com osvoboda at redhat.com
Tue Mar 1 16:44:39 UTC 2016


Ondřej Svoboda has uploaded a new change for review.

Change subject: vdsm-restore-net-config: use existing means to disable IPv6 in setupNetworks
......................................................................

vdsm-restore-net-config: use existing means to disable IPv6 in setupNetworks

The functionality was duplicated in unified restoration (and never
implemented in ifcfg_restoration). Now all networks with no IPv6
configuration (even bridgeless ones) are passed to setupNetworks.

In the following patch, setupNetworks will learn to disable IPv6
on bridgeless networks.

Change-Id: Ie3e2cd9d8e26ccd99df66ed6715a6d38ff56e1af
Signed-off-by: Ondřej Svoboda <osvoboda at redhat.com>
---
M vdsm/vdsm-restore-net-config
1 file changed, 12 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/20/54220/1

diff --git a/vdsm/vdsm-restore-net-config b/vdsm/vdsm-restore-net-config
index 46cecac..58f7abb 100755
--- a/vdsm/vdsm-restore-net-config
+++ b/vdsm/vdsm-restore-net-config
@@ -34,13 +34,11 @@
 from vdsm import ipwrapper
 from vdsm import hostdev
 from vdsm.netinfo import nics, misc
-from vdsm.netinfo.misc import ipv6_supported
 from vdsm.netinfo.cache import CachingNetInfo
 from vdsm import kernelconfig
 from vdsm.constants import P_VDSM_RUN
 from vdsm.netconfpersistence import RunningConfig, PersistentConfig, \
     CONF_PERSIST_DIR, BaseConfig
-from vdsm import sysctl
 from vdsm.utils import monotonic_time
 
 # Ifcfg persistence restoration
@@ -130,6 +128,7 @@
 
     _wait_for_for_all_devices_up(
         available_config.networks.keys() + available_config.bonds.keys())
+    _disable_unwanted_ipv6(available_config)
     changed_config = _filter_changed_nets_bonds(available_config)
     nets = changed_config.networks
     bonds = changed_config.bonds
@@ -139,8 +138,6 @@
                       'and bond (%s).', nets, bonds)
         setupNetworks(nets, bonds, {'connectivityCheck': False,
                                     '_inRollback': True})
-    if ipv6_supported():
-        _restore_disable_ipv6(available_config.networks)
 
 
 def _verify_all_devices_are_up(owned_ifcfg_files):
@@ -276,6 +273,8 @@
         else:
             logging.info("%s was not changed since last time it was persisted,"
                          " skipping restoration.", name)
+        # Remove the trigger added by _disable_unwanted_ipv6.
+        persisted_attrs.pop('disable_ipv6', None)
     return changed_or_missing
 
 
@@ -350,16 +349,18 @@
                not l.oper_up)
 
 
-def _restore_disable_ipv6(networks):
+def _disable_unwanted_ipv6(persistent_config):
     """
-    Disable IPv6 on bridges with no IPv6 configuration, after networks have
-    been restored. This is implemented for unified persistence only.
+    Disable IPv6 altogether for networks with no IPv6 configuration during
+    unified restoration.
     """
-    for net, net_attr in six.iteritems(networks):
-        if net_attr.get('bridged') and not net_attr.get('ipv6addr') and not (
+    for net, net_attr in six.iteritems(persistent_config.networks):
+        if not net_attr.get('ipv6addr') and not (
                 net_attr.get('ipv6autoconf')) and not net_attr.get('dhcpv6'):
-            # _wait_for_for_all_devices_up has already run, so assuming up
-            sysctl.disable_ipv6(net)
+            # The attribute below doesn't exist in the setupNetworks API and
+            # is only used in this module to always trigger setupNetworks to
+            # eventually run systcl.disable_ipv6 on the network.
+            net_attr['disable_ipv6'] = True
 
 
 def _owned_ifcfg(link_name):


-- 
To view, visit https://gerrit.ovirt.org/54220
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie3e2cd9d8e26ccd99df66ed6715a6d38ff56e1af
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda at redhat.com>


More information about the vdsm-patches mailing list