Moti Asayag has uploaded a new change for review.

Change subject: engine: Block labeling a bond without slaves
......................................................................

engine: Block labeling a bond without slaves

SetupNetworks doesn't support a bond without at least
2 slaves, therefore such bonds shouldn't be labeled.

Bug-Url: http://bugzilla.redhat.com/1054187
Change-Id: Ifeb8854797d397aaaf23001ff481b39916289445
Signed-off-by: Moti Asayag <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/LabelNicCommand.java
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/73/24573/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/LabelNicCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/LabelNicCommand.java
index 7439865..e2f1e22 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/LabelNicCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/LabelNicCommand.java
@@ -69,6 +69,22 @@
             return 
failCanDoAction(VdcBllMessages.IMPROPER_INTERFACE_IS_LABELED);
         }
 
+        if (Boolean.TRUE.equals(getNic().getBonded())) {
+            int slavesCount = 0;
+            for (VdsNetworkInterface nic : getHostInterfaces()) {
+                if (StringUtils.equals(getNic().getName(), nic.getBondName())) 
{
+                    slavesCount++;
+                    if (slavesCount == 2) {
+                        break;
+                    }
+                }
+            }
+
+            if (slavesCount < 2) {
+                return 
failCanDoAction(VdcBllMessages.IMPROPER_INTERFACE_IS_LABELED);
+            }
+        }
+
         for (VdsNetworkInterface nic : getHostInterfaces()) {
             if (!StringUtils.equals(nic.getName(), getNicName()) && 
NetworkUtils.isLabeled(nic)
                     && nic.getLabels().contains(getLabel())) {


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifeb8854797d397aaaf23001ff481b39916289445
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Moti Asayag <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to