[ovs-dev] [PATCH 2/2] xenserver: Various cleanups to get OVS to work with XenServer 5.5

Justin Pettit jpettit at nicira.com
Thu Feb 18 12:56:54 PST 2010


---
 xenserver/etc_xensource_scripts_vif                |    8 +++++++-
 .../opt_xensource_libexec_InterfaceReconfigure.py  |    1 +
 ...ensource_libexec_InterfaceReconfigureVswitch.py |    8 ++++++--
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/xenserver/etc_xensource_scripts_vif b/xenserver/etc_xensource_scripts_vif
index 9113159..110f03b 100755
--- a/xenserver/etc_xensource_scripts_vif
+++ b/xenserver/etc_xensource_scripts_vif
@@ -164,7 +164,13 @@ remove_from_bridge()
 
 NETWORK_MODE=$(cat /etc/xensource/network.conf)
 ACTION=$1
-TYPE=$2
+
+# Older versions of XenServer do not pass in the type as an argument
+if [[ $# -lt 2 ]]; then
+    TYPE=vif
+else
+    TYPE=$2
+fi
 
 case $NETWORK_MODE in
     bridge|vswitch) ;;
diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigure.py b/xenserver/opt_xensource_libexec_InterfaceReconfigure.py
index 229f3b9..33f541a 100644
--- a/xenserver/opt_xensource_libexec_InterfaceReconfigure.py
+++ b/xenserver/opt_xensource_libexec_InterfaceReconfigure.py
@@ -332,6 +332,7 @@ class DatabaseCache(object):
         defs = [ (a, b.strip("'")) for (a,b) in defs ]
 
         return dict(defs)
+
     def __pif_on_host(self,pif):
         return self.__pifs.has_key(pif)
 
diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py
index 7ba0d24..a9020c4 100644
--- a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py
+++ b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py
@@ -191,7 +191,7 @@ def datapath_modify_config(commands):
 # Toplevel Datapath Configuration.
 #
 
-def configure_datapath(pif):
+def configure_datapath(pif, parent=None, vlan=None):
     """Bring up the datapath configuration for PIF.
 
     Should be careful not to glitch existing users of the datapath, e.g. other VLANs etc.
@@ -346,7 +346,11 @@ class DatapathVswitch(Datapath):
 
         ipdev = self._ipdev
         bridge = pif_bridge_name(self._dp)
-        c,e = configure_datapath(self._dp)
+        if pif_is_vlan(self._pif):
+            datapath = pif_datapath(self._pif)
+            c,e = configure_datapath(self._dp, datapath, pifrec['VLAN'])
+        else:
+            c,e = configure_datapath(self._dp)
         cfgmod_argv += c
         extra_ports += e
 
-- 
1.6.5.5





More information about the dev mailing list