Ido Barkan has uploaded a new change for review. Change subject: net: Force blocking DHCP when restoring networks ......................................................................
net: Force blocking DHCP when restoring networks This is done right before restoring the network configuration, and before calling setupNetworks. It forces the configurator to wait for an IP address to be configured on the devices before restoration is completed. This prevents VDSM from possibly report missing IP addresses on interfaces that had been restored right before it was started. Change-Id: Ibc8b84a82794ac97eba6d34ec9d54430e387b659 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1218637 Signed-off-by: Ido Barkan <ibar...@redhat.com> Change-Id: Ib9eb07f7dc54d9167460ea9936d68b77b96564d6 Signed-off-by: Ido Barkan <ibar...@redhat.com> --- M vdsm/vdsm-restore-net-config 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/40567/1 diff --git a/vdsm/vdsm-restore-net-config b/vdsm/vdsm-restore-net-config index d7cb8c7..515a03a 100755 --- a/vdsm/vdsm-restore-net-config +++ b/vdsm/vdsm-restore-net-config @@ -73,11 +73,27 @@ persistentConfig = PersistentConfig() nets, bonds = _filter_nets_bonds(persistentConfig.networks, persistentConfig.bonds) + _convert_to_blocking_dhcp(nets) logging.debug('Calling setupNetworks with networks (%s) and bond (%s).', nets, bonds) setupNetworks(nets, bonds, connectivityCheck=False, _inRollback=True) +def _convert_to_blocking_dhcp(networks): + """ + This function changes DHCP configuration, if present, to be blocking. + + This is done right before restoring the network configuration, and forces + the configurator to wait for an IP address to be configured on the devices + before restoration is completed. This prevents VDSM to possibly report + missing IP address on interfaces that had been restored right before it was + started. + """ + for net, net_attr in networks.iteritems(): + if net_attr.get('bootproto') == 'dhcp': + net_attr['blockingdhcp'] = True + + def _filter_nets_bonds(nets, bonds): """Returns only nets and bonds that can be configured with the devices present in the system""" -- To view, visit https://gerrit.ovirt.org/40567 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib9eb07f7dc54d9167460ea9936d68b77b96564d6 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.5 Gerrit-Owner: Ido Barkan <ibar...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches