From e404c41feade9d44ffc3711407f8d6e61340171a Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 10 Dec 2009 15:35:29 -0800 Subject: [PATCH] xenserver: Implement clearing database at boot. --- xenserver/etc_init.d_vswitch | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/xenserver/etc_init.d_vswitch b/xenserver/etc_init.d_vswitch index ea2db629..de7cda3e 100755 --- a/xenserver/etc_init.d_vswitch +++ b/xenserver/etc_init.d_vswitch @@ -80,6 +80,7 @@ brcompatd="/usr/sbin/ovs-brcompatd" dpctl="/usr/bin/ovs-dpctl" appctl="/usr/bin/ovs-appctl" ofctl="/usr/bin/ovs-ofctl" +vsctl="/usr/bin/ovs-vsctl" if [ "$ENABLE_FAKE_PROC_NET" = "y" ]; then @@ -348,18 +349,16 @@ function start { warning "$OVSDB_SERVER_DB does not exist" action "Creating empty $OVSDB_SERVER_DB" $ovsdb_tool create "$OVSDB_SERVER_DB" "$VSWITCHD_OVSDB_SCHEMA" action "Creating initial table in $OVSDB_SERVER_DB" $ovsdb_tool transact "$OVSDB_SERVER_DB" '[{"op": "insert", "table": "Open_vSwitch", "row": {}}]' - #elif [ ! -e /var/run/vswitch.booted ]; then - #touch /var/run/vswitch.booted - #/usr/bin/ovs-cfg-mod '-vANY:console:emer' -F "$VSWITCHD_CONF" \ - #'--del-match=bridge.*' \ - #'--del-match=port.*' \ - #'--del-match=bonding.*' \ - #'--del-match=iface.*' \ - #'--del-match=vlan.*.trunks=*' \ - #'--del-match=vlan.*.tag=*' fi start_ovsdb_server + if [ ! -e /var/run/vswitch.booted ]; then + touch /var/run/vswitch.booted + for bridge in $($vsctl list-br); do + $vsctl --no-wait del-br $bridge + done + fi + start_vswitchd start_brcompatd reload_vswitchd # ensures ovs-vswitchd has fully read config. -- 2.30.2