Muli Salem has posted comments on this change.

Change subject: engine: Block non-exclusive network configurations (#851134)
......................................................................


Patch Set 1: (2 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetupNetworksHelper.java
Line 266:      *            The type of the network.
Line 267:      */
Line 268:     private void validateNetworkExclusiveOnIface(VdsNetworkInterface 
iface, NetworkType networkType) {
Line 269:         String ifaceName = NetworkUtils.StripVlan(iface.getName());
Line 270:         if (ifacesWithExclusiveNetwork.containsKey(ifaceName)) {
The nesting can be removed and the condition below can be simplified.
Line 271:             if ((networkType == NetworkType.VLAN && 
ifacesWithExclusiveNetwork.get(ifaceName) == NetworkType.VM)
Line 272:                     || networkType != NetworkType.VLAN) {
Line 273:                 
addViolation(VdcBllMessages.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK, 
ifaceName);
Line 274:             }


Line 268:     private void validateNetworkExclusiveOnIface(VdsNetworkInterface 
iface, NetworkType networkType) {
Line 269:         String ifaceName = NetworkUtils.StripVlan(iface.getName());
Line 270:         if (ifacesWithExclusiveNetwork.containsKey(ifaceName)) {
Line 271:             if ((networkType == NetworkType.VLAN && 
ifacesWithExclusiveNetwork.get(ifaceName) == NetworkType.VM)
Line 272:                     || networkType != NetworkType.VLAN) {
This will miss in case first a VLAN is added, and then a VmNetwork.
Line 273:                 
addViolation(VdcBllMessages.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK, 
ifaceName);
Line 274:             }
Line 275:         }
Line 276: 


--
To view, visit http://gerrit.ovirt.org/7664
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2712b6e6948de0881c56d519bbf82f7ecc7f6157
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Mike Kolesnik <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Muli Salem <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to