From 69af2fcbdedfe6eab77c4c748a911caa78366590 Mon Sep 17 00:00:00 2001
From: Igor Lvovsky <ilvovsky@redhat.com>
Date: Tue, 12 Jun 2012 16:03:04 +0300
Subject: [PATCH 11/17] Add bridge on top of VLAN if exists
In VLAN case we should attach bridge only to the VLAN
rather than to underlying NICs or bond
Change-Id: I1c554853b5be9330933174da810b6d67c83eb96e
Signed-off-by: Igor Lvovsky <ilvovsky@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/5284
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Tested-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/5553
Tested-by: Federico Simoncelli <fsimonce@redhat.com>
---
vdsm/configNetwork.py | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 5353d0e..97aec7c 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -617,16 +617,19 @@ def addNetwork(network, vlan=None, bonding=None, nics=None, ipaddr=None, netmask
mtu=mtu, gateway=gateway, **options)
ifdown(network)
+ # For VLAN we should attach bridge only to the VLAN device
+ # rather than to underlying NICs or bond
brName = network if bridged else None
+ bridgeForNic = None if vlan else brName
- # nics must be activated in the same order of boot time to expose the correct
- # MAC address.
+ # NICs must be activated in the same order of boot time
+ # to expose the correct MAC address.
for nic in nicSort(nics):
- configWriter.addNic(nic, bonding=bonding, bridge=brName,
+ configWriter.addNic(nic, bonding=bonding, bridge=bridgeForNic,
mtu=max(prevmtu, mtu))
ifup(nic)
if bonding:
- configWriter.addBonding(bonding, bridge=brName,
+ configWriter.addBonding(bonding, bridge=bridgeForNic,
bondingOptions=bondingOptions,
mtu=max(prevmtu, mtu))
ifup(bonding)
--
1.7.1