Commit 4e11b844 authored by Robert Ricci's avatar Robert Ricci
Browse files

New for subnodes: the host of a subnode now automatically gets a

desire for 'hosts-<type>', where <type> is the type of its child node.
This helps assign, because it can now limit the number of places to
try assigning the host, and it means that we can give the hosts this
feature, so that they don't get used for other purposes. For example,
we can give the IXP-hosting nodes the feature 'hosts-ixp-bv' with
weight 1, and they will never get used for anything but IXP hosting.

This means that the node_type_features (or just node_features) table
must now have hosts-<type> entires to work correctly.
parent 2a23edce
......@@ -56,8 +56,9 @@ Node instproc init {s} {
$self set virthost 0
# Sorta ditto for subnode stuff.
$self set issubnode 0
$self set subnodehost 0
$self set issubnode 0
$self set subnodehost 0
$self set subnodechild ""
# If osid remains blank when updatedb is called it is changed
# to the default OS based on it's type (taken from node_types
......@@ -313,6 +314,7 @@ Node instproc set_fixed {pnode} {
# $pnode is an object instance of class Node
if {$issubnode} {
$pnode set subnodehost 1
$pnode set subnodechild $self
} else {
perror "\[set-fixed] Improper fix-node $self to $pnode!"
......@@ -251,6 +251,17 @@ Simulator instproc run {} {
$obj fill_ips
# Go through the list of nodes, and find subnode hosts - we have to add a
# desire to them to have the hosts-<type-of-child> feature
foreach node [lsort [array names node_list]] {
if { [$node set subnodehost] == 1 } {
set child [$node set subnodechild]
set childtype [$child set type]
$node add-desire "hosts-$childtype" 1.0
# Mark that a run statement exists
set ran 1
......@@ -278,7 +289,7 @@ Simulator instproc run {} {
# If we are running in impotent mode we stop here
if {$impotent == 1 && $passmode == 0} {return}
$self spitxml_init
# update the global nseconfigs using a bogus vname
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment