Merge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch
authorGiuseppe Lettieri <g.lettieri@iet.unipi.it>
Tue, 11 Sep 2012 13:36:45 +0000 (15:36 +0200)
committerGiuseppe Lettieri <g.lettieri@iet.unipi.it>
Tue, 11 Sep 2012 13:36:45 +0000 (15:36 +0200)
Conflicts:
planetlab/exp-tool/Makefile
planetlab/scripts/sliver-ovs

1  2 
planetlab/exp-tool/Makefile
planetlab/scripts/sliver-ovs

@@@ -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
@@@ -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 \