Dan Kenigsberg has submitted this change and it was merged.
Change subject: netinfo: Simplify the check if an interface still has any other users.
......................................................................
netinfo: Simplify the check if an interface still has any other users.
In current oVirt network models, a nic device has four kinds
of usages:
* bonding's slave
* vlan's slave
* bridge's port
* bridgeless network's interface
A bond device has the same usages as nic except the first one.
And an interface(nic or bonding) could be multiplexed by different usages.
But bonding and bridge need use the interface exclusively. So only two
combinations are valid:
* multiple vlan users
* multiple vlan users with one bridgeless network user
When we remove one user of an interface, we need check if the interface
still has by other users except the user being removed currently. According
to that, we decide if restore the interface to initial state or destroy it
(for bonding).
The original code can work fine both with the netinfo instantiated before
or after the user is removed. In the new code, it needs an updated netinfo
instance, which doesn't include the user is already removed. And it doesn't
require any information about the user removed.
In the original implementation, the checks for nic and bonding are handled differently
because it also checks the bond users if a nic is a slave of bond. Actually,
it's not neccessary either. If the bond has other users, we will not remove its
slave. That means the check will not be invoked. So for the check of nic, it
doesn't need care about the usage of its bond master, because it's done in bond
level.
Change-Id: Ie70cbfcc4c561c98f2e90685329900796517f933
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
M lib/vdsm/netinfo.py
M vdsm/configNetwork.py
2 files changed, 4 insertions(+), 33 deletions(-)
Approvals:
Antoni Segura Puimedon: Verified; Looks good to me, but someone else must approve
Mark Wu: Verified
Dan Kenigsberg: Looks good to me, approved
--
To view, visit
http://gerrit.ovirt.org/15416
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie70cbfcc4c561c98f2e90685329900796517f933
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: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server