]> xenbits.xensource.com Git - xcp/xen-api.git/commitdiff
[PATCH] xenserver: Accept VLAN PIFs in pif_bridge_name().
authorBen Pfaff <blp@nicira.com>
Thu, 8 Jul 2010 13:25:51 +0000 (14:25 +0100)
committerBen Pfaff <blp@nicira.com>
Thu, 8 Jul 2010 13:25:51 +0000 (14:25 +0100)
From 6987c81c05f21c579fbe60e9b6693862abbbb762 Mon Sep 17 00:00:00 2001
Date: Mon, 22 Feb 2010 12:53:17 -0800
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.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 ...ensource_libexec_InterfaceReconfigureVswitch.py |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

scripts/InterfaceReconfigureVswitch.py

index af797d452e11b7ea0ef6fef772d51bf36e351335..13bee08363a1d809aecf6193e319faa6c861488c 100644 (file)
@@ -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: