Mike Kolesnik has posted comments on this change.

Change subject: engine: Adjust SetupNetworks to accept any vlan device name
......................................................................


Patch Set 6: Code-Review-1

(4 comments)

In most of the cases you could 'seed' the base interface name in the 
parameters, but on check if interface exists this won't be possible..

http://gerrit.ovirt.org/#/c/26616/6/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/SetupNetworksHelper.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/SetupNetworksHelper.java:

Line 150:      * Validates that all interfaces exist on the host, except bonds 
that may be created.
Line 151:      */
Line 152:     private void validateInterfacesExist() {
Line 153:         for (VdsNetworkInterface iface : params.getInterfaces()) {
Line 154:             String nameWithoutVlanId = NetworkUtils.stripVlan(iface);
You can't consider the base interface name here since it's not mandatory (and 
won't be).
Line 155:             if (!getExistingIfaces().containsKey(nameWithoutVlanId) 
&& !bonds.containsKey(nameWithoutVlanId)) {
Line 156:                 
addViolation(VdcBllMessages.NETWORK_INTERFACES_DONT_EXIST, nameWithoutVlanId);
Line 157:             }
Line 158:         }


Line 227:     private List<Network> findNetworksOnInterface(VdsNetworkInterface 
iface) {
Line 228:         String nameWithoutVlanId = NetworkUtils.stripVlan(iface);
Line 229:         List<Network> networks = new ArrayList<Network>();
Line 230:         for (VdsNetworkInterface tmp : params.getInterfaces()) {
Line 231:             if (NetworkUtils.stripVlan(tmp).equals(nameWithoutVlanId) 
&& tmp.getNetworkName() != null) {
Same comment..
Line 232:                 if 
(getExistingClusterNetworks().containsKey(tmp.getNetworkName())) {
Line 233:                     
networks.add(getExistingClusterNetworks().get(tmp.getNetworkName()));
Line 234:                 }
Line 235:             }


Line 440:      * @param networkType
Line 441:      *            The type of the network.
Line 442:      */
Line 443:     private void validateNetworkExclusiveOnIface(VdsNetworkInterface 
iface, NetworkType networkType) {
Line 444:         String ifaceName = NetworkUtils.stripVlan(iface);
Same comment
Line 445:         List<NetworkType> networksOnIface = 
ifacesWithExclusiveNetwork.get(ifaceName);
Line 446: 
Line 447:         if (networksOnIface == null) {
Line 448:             networksOnIface = new 
ArrayList<SetupNetworksHelper.NetworkType>();


http://gerrit.ovirt.org/#/c/26616/6/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/SetupNetworksVDSCommand.java
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/SetupNetworksVDSCommand.java:

Line 40:         for (Network network : getParameters().getNetworks()) {
Line 41:             Map<String, Object> opts = new HashMap<String, Object>();
Line 42:             VdsNetworkInterface iface =
Line 43:                     findNetworkInterface(network.getName(), 
getParameters().getInterfaces(), getParameters().getBonds());
Line 44:             String ifaceNameWithoutVlan = 
NetworkUtils.stripVlan(iface);
Same comment as in SetupNetworkHelper
Line 45:             Boolean bonded = 
findInterfaceByName(ifaceNameWithoutVlan).getBonded();
Line 46:             String type = (bonded != null && bonded) ? "bonding" : 
"nic";
Line 47:             opts.put(type, ifaceNameWithoutVlan);
Line 48:             if (NetworkUtils.isVlan(network)) {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic08c952a7c1902d176709af7126f54ab37a0344d
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alona Kaplan <alkap...@redhat.com>
Gerrit-Reviewer: Mike Kolesnik <mkole...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to