From 621ffea966bf3aedaa8ceadbb43f3cd642854ad6 Mon Sep 17 00:00:00 2001 From: Giuseppe Lettieri Date: Thu, 27 Sep 2012 16:27:47 +0200 Subject: [PATCH] move set-controller to sliver-ovs --- planetlab/exp-tool/Makefile | 2 +- planetlab/scripts/sliver-ovs.in | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/planetlab/exp-tool/Makefile b/planetlab/exp-tool/Makefile index 09560eeb4..0e523721c 100644 --- a/planetlab/exp-tool/Makefile +++ b/planetlab/exp-tool/Makefile @@ -147,7 +147,7 @@ cache/bridge.%: cache/switch.% cache/controller.%: cache/bridge.% @echo "Setting controller on $(call display,$*) - logs in $(call log,$@)" - @$(SSH) $(HOST_$*) $(SUDO) ovs-vsctl set-controller $(BRIDGE) $(CONTROLLER_$*) &> $(call log,$@) || { rm $@; exit 1; } + @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs set-controller $(BRIDGE) $(CONTROLLER_$*) &> $(call log,$@) || { rm $@; exit 1; } # xxx this probably needs a more thorough cleanup in cache/ cache/stop.%: del-bridge.% diff --git a/planetlab/scripts/sliver-ovs.in b/planetlab/scripts/sliver-ovs.in index dfd596f9f..9b7495013 100755 --- a/planetlab/scripts/sliver-ovs.in +++ b/planetlab/scripts/sliver-ovs.in @@ -197,6 +197,17 @@ function set_remote_endpoint () { options:remote_port=$remote_UDP_port } +function set_controller () { + + get_params "bridge_name controller" "$@" + + # ensure ovs-vswitchd is running + is_switch_running || { echo "ovs-vswitchd not running" >&2 ; exit 1 ; } + + set -e + ovs-vsctl --db=unix:$DB_SOCKET set-controller "$bridge_name" "$controller" +} + #################### del functions function del_bridge () { -- 2.43.0