From: Ethan Jackson Date: Thu, 10 Mar 2011 00:12:10 +0000 (-0800) Subject: xenserver: Delete Bridge when creating vlan. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ec4d255acc5628f395fde8aff84a7027c2dc1c9;p=openvswitch xenserver: Delete Bridge when creating vlan. Commit 34edeccfd8d4273844d12c85fe38ec47002c47cd removed a workaround which still applies to XenServer versions older than 5.5. This could causes creation of vlans to fail in some cases. CC: "David Tsai" Bug #4877. --- diff --git a/tests/interface-reconfigure.at b/tests/interface-reconfigure.at index 14709676..9749fd58 100644 --- a/tests/interface-reconfigure.at +++ b/tests/interface-reconfigure.at @@ -743,6 +743,7 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi3 configuration set Bridge xenbr3 fail_mode=standalone remove Bridge xenbr3 other_config disable-in-band br-set-external-id xenbr3 xs-network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6 + --if-exists del-br xapi3 --may-exist add-br xapi3 xenbr3 123 br-set-external-id xapi3 xs-network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6 set Interface xapi3 MAC="00:15:17:a0:29:81" @@ -916,6 +917,7 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi2 configuration set Bridge xapi1 fail_mode=standalone remove Bridge xapi1 other_config disable-in-band br-set-external-id xapi1 xs-network-uuids 45cbbb43-113d-a712-3231-c6463f253cef;99be2da4-6c33-6f8e-49ea-3bc592fe3c85 + --if-exists del-br xapi2 --may-exist add-br xapi2 xapi1 4 br-set-external-id xapi2 xs-network-uuids 45cbbb43-113d-a712-3231-c6463f253cef;99be2da4-6c33-6f8e-49ea-3bc592fe3c85 set Interface xapi2 MAC="00:22:19:22:4b:af" diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py index 661199b4..6c9e3fa8 100644 --- a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py +++ b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py @@ -475,6 +475,10 @@ class DatapathVswitch(Datapath): dpname = pif_bridge_name(self._dp) if pif_is_vlan(self._pif): + # In some cases XAPI may misguidedly leave an instance of + # 'bridge' which should be deleted. + vsctl_argv += ['--', '--if-exists', 'del-br', bridge] + # configure_datapath() set up the underlying datapath bridge. # Stack a VLAN bridge on top of it. vsctl_argv += ['--', '--may-exist', 'add-br',