From ff71b4aa99b6d7305340d1b588c18cfd01b9a9de Mon Sep 17 00:00:00 2001 From: Giuseppe Lettieri Date: Wed, 3 Oct 2012 11:47:09 +0200 Subject: [PATCH] added del-controllers target --- planetlab/exp-tool/Makefile | 8 ++++++++ planetlab/scripts/sliver-ovs.in | 13 ++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/planetlab/exp-tool/Makefile b/planetlab/exp-tool/Makefile index 2997c4a87..bf66afb1d 100644 --- a/planetlab/exp-tool/Makefile +++ b/planetlab/exp-tool/Makefile @@ -118,6 +118,9 @@ CONTROLLERS=$(foreach id,$(ALL_NODE_IDS),cache/controller.$(id)) controllers: $(CONTROLLERS) .PHONY: controllers +del-controllers: $(foreach id,$(ALL_NODE_IDS),del-controller-$(id)) +.PHONY: del-controllers + ### node-oriented targets # check ssh connectivity cache/sshcheck.%: FORCE @@ -183,6 +186,11 @@ del-db.%: @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs stop-db @rm -f cache/db.$* +del-controller.%: + @echo "Removing controller for $(call display,$*)" + @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs del-controller $(BRIDGE) + @rm -f cache/controller.$* + del-links: $(addprefix U/,$(notdir $(filter-out %.log,$(wildcard L/*)))) del-switchs: $(addprefix del-,$(notdir $(filter-out %.log,$(wildcard cache/switch.*)))) diff --git a/planetlab/scripts/sliver-ovs.in b/planetlab/scripts/sliver-ovs.in index 9b7495013..187fb0486 100755 --- a/planetlab/scripts/sliver-ovs.in +++ b/planetlab/scripts/sliver-ovs.in @@ -208,6 +208,17 @@ function set_controller () { ovs-vsctl --db=unix:$DB_SOCKET set-controller "$bridge_name" "$controller" } +function del_controller () { + + get_params "bridge_name" "$@" + + # ensure ovs-vswitchd is running + is_switch_running || { echo "ovs-vswitchd not running" >&2 ; exit 1 ; } + + set -e + ovs-vsctl --db=unix:$DB_SOCKET del-controller "$bridge_name" +} + #################### del functions function del_bridge () { @@ -252,7 +263,7 @@ function show () { SUPPORTED_SUBCOMMANDS="start stop status start_db stop_db start_switch stop_switch create_bridge create_port del_bridge del_port -show set_remote_endpoint" +show set_remote_endpoint set_controller del_controller" function main () { message="Usage: $COMMAND ... -- 2.43.0