Blob Blame History Raw
From 3060b9110bb37ee2b05356b37fde4d79b1e46c5f Mon Sep 17 00:00:00 2001
From: Igor Lvovsky <ilvovsky@redhat.com>
Date: Thu, 5 Jul 2012 15:05:14 +0300
Subject: [PATCH 37/40] BZ#837054 - Do not detach network from the bond during
 bond resize

Let's say you have bond and bridged non-VLANed network on it.
This patch will fix detaching such network from the bond during bond resizing.

Change-Id: Idf2a7f73b23dc9692bec9cc3fad01e947a7294af
Signed-off-by: Igor Lvovsky <ilvovsky@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/5970
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/6213
Tested-by: Dan Kenigsberg <danken@redhat.com>
---
 vdsm/configNetwork.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index d277cd6..eb140f8 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -988,6 +988,11 @@ def _editBondings(bondings, configWriter):
     for bond, bondAttrs in bondings.iteritems():
         logger.debug("Creating/Editing bond %s with attributes %s",
                         bond, bondAttrs)
+
+        brNets = list(_netinfo.getBridgedNetworksForNic(bond))
+        # Only one bridged-non-VLANed network allowed on same nic/bond
+        bridge = brNets[0] if brNets else None
+
         if bond in _netinfo.bondings:
             ifdown(bond)
             # Take down all bond's NICs.
@@ -1001,7 +1006,7 @@ def _editBondings(bondings, configWriter):
             configWriter.addNic(nic, bonding=bond)
             ifup(nic)
 
-        configWriter.addBonding(bond,
+        configWriter.addBonding(bond, bridge=bridge,
                                 bondingOptions=bondAttrs.get('options', None))
         ifup(bond)
 
-- 
1.7.7.6