From: Giuseppe Lettieri Date: Tue, 11 Sep 2012 13:36:45 +0000 (+0200) Subject: Merge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch X-Git-Tag: sliver-openvswitch-1.8.90-0~16 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=a03fa095f61bf789af770dff2616ab382327b470 Merge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch Conflicts: planetlab/exp-tool/Makefile planetlab/scripts/sliver-ovs --- a03fa095f61bf789af770dff2616ab382327b470 diff --cc planetlab/exp-tool/Makefile index 804918246,c89f197b3..ae2700866 --- a/planetlab/exp-tool/Makefile +++ b/planetlab/exp-tool/Makefile @@@ -183,21 -188,42 +188,42 @@@ del-iface.%: cache/db.$$(call get,% @rm -f cache/iface.$* cache/link.$* cache/link.$(call opp,$*) - + ### '%' here is leftid-rightid@{1,2} + # we retrieve % as $(*F) + #linkid=$(call linkpart,%) + #nodeid=$(call get,%) + #bridgefile=cache/bridge.$(nodeid) cache/iface.%: cache/bridge.$$(call get,%) - @echo "Creating interface for link $(call proj1,$*) on $(call get,$*)" - @$(SSH) $(HOST_$(call get,$*)) \ - $(SUDO) sliver-ovs create-port $$(cat $^) L$(call proj1,$*) > $@ \ - || { rm $@; exit 1; } - - cache/link.%: cache/host.$$(call rget,$$*) cache/iface.% cache/iface.$$(call opp,$$*) - @echo "Setting port number of link $(call proj1,$*) on $(call get,$*)" - @$(SSH) $(HOST_$(call get,$*)) \ - $(SUDO) sliver-ovs set-remote-endpoint L$(call proj1,$*) \ - $$(cat cache/host.$(call rget,$*)) \ - $$(cat cache/iface.$(call opp,$*)) \ + @echo "Creating interface for link $(call linkpart,$(*F)) on $(call display,$(call get,$(*F))) - logs in $@.log" + @$(SSH) $(call solve,$(call get,$(*F))) $(SUDO) sliver-ovs create-port $$(cat cache/bridge.$(call get,$(*F))) L$(call linkpart,$(*F)) > $@ 2> $@.log || { rm $@; exit 1; } + echo cache/bridge.$(call get,$(*F)) + echo cache/host.$(call get,$(*F)) cache/iface.$(*F) cache/iface.$(call opp,$(*F)) + + + # linkid=$(call linkpart,%) + # nodeid=$(call get,%) + # iface1=cache/iface.% + # iface2=cache/iface.$(call opp,%) + cache/link.%: cache/host.$$(call get,%) cache/iface.% cache/iface.$$(call opp,%) + @echo "Setting port number of link $(call linkpart,$(*F)) on $(call display,$(call get,$(*F))) - logs in $@.log" - @$(SSH) $(call solve,$(call get,$(*F))) $(SUDO) ovs-vsctl set interface L$(call linkpart,$(*F)) \ - options:remote_ip=$$(cat cache/host.$(call get,$(*F))) \ - options:remote_port=$$(cat cache/iface.$(call opp,$(*F))) 2> $@.log \ ++ @$(SSH) $(call solve,$(call get,$(*F))) $(SUDO) sliver-ovs set-remote-endpoint L$(call linkpart,$(*F)) \ ++ $$(cat cache/host.$(call rget,$(*F))) \ ++ $$(cat cache/iface.$(call opp,$(*F))) 2> $@.log \ && touch $@ + #################### + CLEANTARGETS=$(addprefix del-,$(notdir $(filter-out %.log,$(wildcard cache/bridge.*)))) + clean: $(CLEANTARGETS) + distclean: + rm -rf L U cache + .PHONY: clean distclean + + #################### + graph.dot: + ( echo "digraph $(SLICE) {"; ls L | sed 's/$(SEP)/->/;s/$$/;/'; echo "}" ) > $@ + graph.ps: graph.dot + dot -Tps < $^ > $@ + #################### # 'virtual' targets in that there's no real file attached define node_shortcuts diff --cc planetlab/scripts/sliver-ovs index dabb01671,6a7319843..87f173e2b --- a/planetlab/scripts/sliver-ovs +++ b/planetlab/scripts/sliver-ovs @@@ -115,21 -100,12 +115,14 @@@ function start_db () echo 'ovsdb-server appears to be running already, *not* starting' fi wait_server $DB_PID_FILE ovsdb-server 30 + echo $DB_PID_FILE } - function stop_db () { - get_params "" "$@" - - pkill ovsdb-server - } - - - function start_switch () { + get_params "" "$@" - [[ -n "$@" ]] && error "Usage: $COMMAND start-switch" + # ensure ovsdb-server is running + is_db_running || { echo "ovsdb-server not running" >&2 ; exit 1 ; } if [ ! -f "$SWITCH_PID_FILE" ] ; then ovs-vswitchd \