move set-controller to sliver-ovs
authorGiuseppe Lettieri <g.lettieri@iet.unipi.it>
Thu, 27 Sep 2012 14:27:47 +0000 (16:27 +0200)
committerGiuseppe Lettieri <g.lettieri@iet.unipi.it>
Thu, 27 Sep 2012 14:27:47 +0000 (16:27 +0200)
planetlab/exp-tool/Makefile
planetlab/scripts/sliver-ovs.in

index 09560ee..0e52372 100644 (file)
@@ -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.%
index dfd596f..9b74950 100755 (executable)
@@ -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 () {