xenserver: Remove a VLAN's bridge when bringing down its PIF.
authorBen Pfaff <blp@nicira.com>
Mon, 22 Feb 2010 21:32:01 +0000 (13:32 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 23 Feb 2010 17:55:39 +0000 (09:55 -0800)
Before, interface-reconfigure would only bring remove a VLAN's bridge
incidentally as part of removing its datapath's bridge.  This commit fixes
it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py

index 1dcac61d51927e56335dfff4a98f315b5c987530..73c0104a38e32bf86308a79e1d9b0303b2e57ebc 100644 (file)
@@ -260,7 +260,7 @@ def configure_datapath(pif):
     vsctl_argv += set_br_external_ids(pif)
     return vsctl_argv,extra_up_ports
 
-def deconfigure_datapath(pif):
+def deconfigure_bridge(pif):
     vsctl_argv = []
 
     bridge = pif_bridge_name(pif)
@@ -400,6 +400,9 @@ class DatapathVswitch(Datapath):
         vsctl_argv += datapath_deconfigure_ipdev(ipdev)
 
         if pif_is_vlan(self._pif):
+            # Delete the VLAN bridge.
+            vsctl_argv += deconfigure_bridge(self._pif)
+
             # If the VLAN's slave is attached, leave datapath setup.
             slave = pif_get_vlan_slave(self._pif)
             if db().get_pif_record(slave)['currently_attached']:
@@ -423,6 +426,6 @@ class DatapathVswitch(Datapath):
                 dp = None
 
         if dp:
-            vsctl_argv += deconfigure_datapath(dp)
+            vsctl_argv += deconfigure_bridge(dp)
 
         datapath_modify_config(vsctl_argv)