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

Ben Pfaff blp at nicira.com
Thu Feb 18 21:13:11 UTC 2010


See inline comments below:

On Thu, Feb 18, 2010 at 12:56:54PM -0800, Justin Pettit wrote:
> 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) ;;

This part looks good...

> 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)
>  

...OK...

> 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

But I don't understand this.  configure_datapath() doesn't do anything
with its new 'parent' or 'vlan' arguments (you didn't add any code to do
anything with them), so I don't understand what this actually changes.




More information about the dev mailing list