[ovs-dev] [PATCH 03/12] xenserver: Accept VLAN PIFs in pif_bridge_name().

Ian Campbell Ian.Campbell at citrix.com
Tue Feb 23 02:04:37 PST 2010


I think this commit makes pif_bridge_name the same in
InterfaceReconfigureBridge.py and InterfaceReconfigureVswitch.py.
Perhaps we could hoist the function into InterfaceReconfigure.py?

Ian.

On Tue, 2010-02-23 at 00:42 +0000, Ben Pfaff wrote:
> pif_bridge_name() was written when the vswitch interface-reconfigure was
> working with the raw Open vSwitch configuration via ovs-cfg-mod.  Then,
> it made no sense to ask for the "bridge name" of a VLAN PIF, because a
> VLAN PIF didn't have a bridge.
> 
> Now, however, the vSwitch interface-reconfigure works with ovs-vsctl, which
> provides a thin layer over the OVS configuration that makes VLAN bridges
> appear to exist.  So now it makes sense to ask for the bridge of a VLAN
> PIF, and this commit enables that.
> ---
>  ...ensource_libexec_InterfaceReconfigureVswitch.py |    7 +------
>  1 files changed, 1 insertions(+), 6 deletions(-)
> 
> diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py
> index e938d1a..f777b17 100644
> --- a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py
> +++ b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py
> @@ -43,15 +43,10 @@ def netdev_up(netdev, mtu=None):
>  def pif_bridge_name(pif):
>      """Return the bridge name of a pif.
>  
> -    PIF must not be a VLAN and must be a bridged PIF."""
> +    PIF must be a bridged PIF."""
>  
>      pifrec = db().get_pif_record(pif)
> -
> -    if pif_is_vlan(pif):
> -        raise Error("PIF %(uuid)s cannot be a bridge, VLAN is %(VLAN)s" % pifrec)
> -
>      nwrec = db().get_network_record(pifrec['network'])
> -
>      if nwrec['bridge']:
>          return nwrec['bridge']
>      else:






More information about the dev mailing list