Giuseppe Vallarelli has posted comments on this change.
Change subject: Improve the checking of mulitple direct users on an interface.
......................................................................
Patch Set 2: (3 inline comments)
....................................................
File lib/vdsm/netinfo.py
Line 600: if iface == vdict['iface']:
Line 601: users.add(v)
Line 602: return users
Line 603:
Line 604: def ifaceHasMultiUsers(self, iface):
Mark I've added a comment on the usage of this method.
Line 605: """
Line 606: Checks if the interface has multiple direct users. It could only happen
Line 607: in the following two cases:
Line 608: --> vlan1 --> network1 (bridged or
bridgeless)
....................................................
File vdsm/configNetwork.py
Line 230:
Line 231: def _removeUnusedNics(nics, configWriter):
Line 232: _netinfo = netinfo.NetInfo()
Line 233: for nic in nics:
Line 234: if not _netinfo.ifaceHasMultiUsers(nic):
Instead of if not why if _netifo.ifaceHasZeroOrOneUser
Line 235: ifdown(nic)
Line 236: configWriter.removeNic(nic)
Line 237: ifup(nic)
Line 238:
Line 325:
Line 326: # The (relatively) new setupNetwork verb allows to remove a network
Line 327: # defined on top of an bonding device without break the bond itself.
Line 328: if implicitBonding:
Line 329: if bonding and not _netinfo.ifaceHasMultiUsers(bonding):
See comment above.
Line 330: ifdown(bonding)
Line 331: configWriter.removeBonding(bonding)
Line 332:
Line 333: _removeUnusedNics(nics, configWriter)
--
To view, visit
http://gerrit.ovirt.org/14872
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1e8bc4d8ee8709f72a5746edc2d61f320ef1a2ab
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server