]> git.entuzijast.net Git - imunes.git/commitdiff
prebacio destroy akcije u l3node.destroy funkciju (na FreeBSDu je bilo u opcem cleanu...
authorJosip Rodin <joy@numa-ubuntu-vm.(none)>
Sun, 13 Sep 2009 11:52:20 +0000 (13:52 +0200)
committerJosip Rodin <joy@numa-ubuntu-vm.(none)>
Sun, 13 Sep 2009 11:52:20 +0000 (13:52 +0200)
linux/exec.tcl

index 7ff0340baef8129e005749ff210fb4076b38f4c0..fff06d94cf983b006fad991d8fc30e95080eaa03 100755 (executable)
@@ -587,20 +587,22 @@ proc l3node.shutdown { eid node } {
 #   * node -- node id
 #****
 proc l3node.destroy { eid node } {
-# FIXME
-#      upvar 0 ::cf::[set ::curcfg]::[set node]::node_id node_id
-    set node_id $node
-    foreach ifc [ifcList $node] {
-       puts " nexec vimage $eid ngctl msg $ifc@$node_id: shutdown "
-       
-       set ifnum [string range $ifc 3 end]
-       set ifname [string range $ifc 0 2]
-       if { $ifname == "ser" } {
-           puts " nexec vimage $eid ngctl msg hdlc$ifnum@$node_id: shutdown "
-       }
-    }
-    puts "nexec vimage -d $node_id"
+
+# TODO serial interface support
+#    foreach ifc [ifcList $node] {
+#              puts " nexec vimage $eid ngctl msg $ifc@$node_id: shutdown "
+#      
+#              set ifnum [string range $ifc 3 end]
+#              set ifname [string range $ifc 0 2]
+#              if { $ifname == "ser" } {
+#                  puts " nexec vimage $eid ngctl msg hdlc$ifnum@$node_id: shutdown "
+#              }
+#    }
+
+#    puts "nexec vimage -d $node_id"
+       statline "Stopping VE $node"
     nexec vzctl stop $node
+    statline "Destroying VE $node"
     nexec vzctl destroy $node
 
 # FreeBSD-only:
@@ -952,20 +954,16 @@ proc vimageCleanup { eid } {
     upvar 0 ::cf::[set ::curcfg]::node_list node_list
     puts "Stopping VEs and destroying private enviroments..."
     foreach node $node_list {
-    if { [[typemodel $node].layer] != "LINK" } {
-       set stattxt "Stopping VE $node"
-       statline $stattxt
-               nexec vzctl stop $node
-       set stattxt "Destroying VE $node"
-           statline $stattxt
-               nexec vzctl destroy $node
-    } else {
-        # L2 uredjaji kao hub i switch se u OpenVZ varijanti emulirajusa bridge
-        # suceljem a ne sa VEom, stoga nema se sta gasiti
-        puts "  Node $node is a L2 device emulated with a bridge. Stopping pending bridge cleanup."
-    }
+           if { [[typemodel $node].layer] != "LINK" } {
+               [typemodel $node].destroy $eid $node
+           } else {
+               # L2 uredjaji kao hub i switch se u OpenVZ varijanti emuliraju
+           # bridge suceljem a ne VEom, stoga nema se sto gasiti
+               puts "  Node $node is a L2 device emulated with a bridge. Stopping pending bridge cleanup."
+           }
     }
     puts "  Done."
+
     #TODO:  prebaciti u tcl kod, error handling i modificirati da ne
     #       brise bridgeove bez diskriminacije nego one koje je imunes
     #       napravio