Change in vdsm[master]: NetReload: netmodels for addNetwork
asegurap at redhat.com
asegurap at redhat.com
Fri May 24 11:07:33 UTC 2013
Antoni Segura Puimedon has posted comments on this change.
Change subject: NetReload: netmodels for addNetwork
......................................................................
Patch Set 7: (5 inline comments)
....................................................
File vdsm/configNetwork.py
Line 174: vlanedIfaces = [v['iface'] for v in _netinfo.vlans.values()]
Line 175: if bonding not in vlanedIfaces:
Line 176: for nic in nics:
Line 177: if nic not in vlanedIfaces:
Line 178: ifdown(nic)
Right. I wanted to leave it for a later patch. But since there are other changes to this one, I might get it in also.
Line 179: netEnt.configure(network=network, **options)
Line 180:
Line 181:
Line 182: def assertBridgeClean(bridge, vlan, bonding, nics):
....................................................
File vdsm/netmodels.py
Line 1: # Copyright 2011-2013 Red Hat, Inc.
I'm not that knowledgeable either about this matters, but since I moved code here that was in a 2011 Copyrighted file, I thought I'd put 2011-13. Let's hope that Dan chips in with a clear decision.
Line 2: #
Line 3: # This program is free software; you can redistribute it and/or modify
Line 4: # it under the terms of the GNU General Public License as published by
Line 5: # the Free Software Foundation; either version 2 of the License, or
Line 42: try:
Line 43: ipaddr = self.ip.inet.address
Line 44: netmask = self.ip.inet.netmask
Line 45: gateway = self.ip.inet.gateway
Line 46: bootproto = self.ip.bootproto
Done
Line 47: except AttributeError:
Line 48: ipaddr = netmask = gateway = bootproto = None
Line 49: return ipaddr, netmask, gateway, bootproto
Line 50:
Line 70: def remove(self, network=None, bond=None):
Line 71: self.configurator.removeNic(self, network=network, bond=bond)
Line 72:
Line 73: def __repr__(self):
Line 74: return 'Nic(' + self.name + ')'
Done
Line 75:
Line 76:
Line 77: class Vlan(NetDevice):
Line 78: MAX_VLAN_ID = 4094
Line 180: nics = [nic for nic in _netinfo.getNicsForBonding(name)]
Line 181: mtu = max(int(netinfo.getMtu(name)), mtu)
Line 182: slaves = [Nic.objectivize(nic, configurator, mtu, _netinfo, name)
Line 183: for nic in nics]
Line 184: options = _netinfo.bondings[name]['cfg'].get('BONDING_OPTS')
The thing is that the engine relies on vdsCaps having a 'cfg' field for devices, so even with other configurators, netinfo will have to continue to provide a {'cfg': {'BONDING_OPTS': 'someopt=somevalue'}}.
We could, however, in a future patch, change it into _netinfo.getBondingOpts(name).
Line 185: else:
Line 186: raise ConfigNetworkError(ne.ERR_BAD_BONDING,
Line 187: 'Bonding %s not specified and it is not '
Line 188: 'already on the system' % name)
--
To view, visit http://gerrit.ovirt.org/14303
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iba5c5b84760e27245cbe34c3b290c54e51278e72
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
More information about the vdsm-patches
mailing list