From: Josip Rodin Date: Sun, 13 Sep 2009 11:52:20 +0000 (+0200) Subject: prebacio destroy akcije u l3node.destroy funkciju (na FreeBSDu je bilo u opcem cleanu... X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=98b82bdbbac7c46122ce9e9c3ef51531f1df6e5a;p=imunes.git prebacio destroy akcije u l3node.destroy funkciju (na FreeBSDu je bilo u opcem cleanupu iz nepoznatog razloga) --- diff --git a/linux/exec.tcl b/linux/exec.tcl index 7ff0340..fff06d9 100755 --- a/linux/exec.tcl +++ b/linux/exec.tcl @@ -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