$VSWITCH_BASE/utilities/dpctl show nl:$1 | grep '^ LOCAL(' | cut -d'(' -f2 | cut -d')' -f1
}
+function clear_old_bridge_ports {
+ mv $VSWITCHD_CONF $VSWITCHD_CONF.prev
+ grep -v '^bridge\.[^.]\+\.port[ \t]*=' $VSWITCHD_CONF.prev > $VSWITCHD_CONF
+}
+
function start {
if ! lsmod | grep -q "openflow_mod"; then
action "Inserting openflow module" insmod $VSWITCH_BASE/datapath/linux-2.6/openflow_mod.ko
if [ -n "$MEMLEAK_LOG" ]; then
leak_opt="--check-leaks=$MEMLEAK_LOG"
if [ -e "$MEMLEAK_LOG" ]; then
- mv "$MEMLEAK_LOG" "$MEMLEAK_LOG.last"
+ mv "$MEMLEAK_LOG" "$MEMLEAK_LOG.prev"
fi
fi
+ [ "$1" = "restart" ] || clear_old_bridge_ports
PATH=$VSWITCH_BASE/secchan:$PATH action "Starting vswitchd" nice -n "$PRIORITY" $VSWITCH_BASE/vswitchd/vswitchd -P/var/run/vswitchd.pid -D -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt --brcompat $leak_opt "$VSWITCHD_CONF"
if [ "$1" = "restart" ]; then
sleep 2 # Give time for vswitch to get up and running.