Commit 2202fc5a authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Make the new parser live on mini. New parser ssh'es over to ops to

do the actual parse. The parser now spits out XML instead of DB
queries, and the wrapper on boss converts that to DB insertions after
verification. There are some makefile changes as well to install the
new parser on ops via NFS, since otherwise the parser could
intolerably out of date on ops!
parent f9d065b7
...@@ -65,6 +65,7 @@ ops-install: ...@@ -65,6 +65,7 @@ ops-install:
@$(MAKE) -C event control-install @$(MAKE) -C event control-install
install-mkdirs: install-mkdirs:
-mkdir -p $(INSTALL_TOPDIR)/opsdir
-mkdir -p $(INSTALL_TOPDIR)/locks -mkdir -p $(INSTALL_TOPDIR)/locks
-mkdir -p $(INSTALL_TOPDIR)/log -mkdir -p $(INSTALL_TOPDIR)/log
-mkdir -p $(INSTALL_TOPDIR)/log/mysql -mkdir -p $(INSTALL_TOPDIR)/log/mysql
......
...@@ -1365,7 +1365,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ ...@@ -1365,7 +1365,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
db/dbcheck db/interswitch db/dbboot db/schemacheck \ db/dbcheck db/interswitch db/dbboot db/schemacheck \
db/sitevarscheck \ db/sitevarscheck \
db/grabron db/webnfree db/stategraph db/readycount \ db/grabron db/webnfree db/stategraph db/readycount \
db/idletimes db/idlemail db/webidlemail \ db/idletimes db/idlemail db/webidlemail db/xmlconvert \
discvr/GNUmakefile \ discvr/GNUmakefile \
ipod/GNUmakefile \ ipod/GNUmakefile \
lib/GNUmakefile lib/libtb/GNUmakefile \ lib/GNUmakefile lib/libtb/GNUmakefile \
...@@ -1394,7 +1394,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ ...@@ -1394,7 +1394,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tbsetup/startexp tbsetup/endexp tbsetup/webstartexp tbsetup/webendexp \ tbsetup/startexp tbsetup/endexp tbsetup/webstartexp tbsetup/webendexp \
tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \ tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \
tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \ tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \
tbsetup/ns2ir/parse-ns \ tbsetup/ns2ir/parse-ns tbsetup/ns2ir/parse.proxy \
tbsetup/ns2ir/sim.tcl tbsetup/db2ns \ tbsetup/ns2ir/sim.tcl tbsetup/db2ns \
tbsetup/tbprerun tbsetup/tbswap tbsetup/tbend \ tbsetup/tbprerun tbsetup/tbswap tbsetup/tbend \
tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \ tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \
......
...@@ -402,7 +402,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ ...@@ -402,7 +402,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
db/dbcheck db/interswitch db/dbboot db/schemacheck \ db/dbcheck db/interswitch db/dbboot db/schemacheck \
db/sitevarscheck \ db/sitevarscheck \
db/grabron db/webnfree db/stategraph db/readycount \ db/grabron db/webnfree db/stategraph db/readycount \
db/idletimes db/idlemail db/webidlemail \ db/idletimes db/idlemail db/webidlemail db/xmlconvert \
discvr/GNUmakefile \ discvr/GNUmakefile \
ipod/GNUmakefile \ ipod/GNUmakefile \
lib/GNUmakefile lib/libtb/GNUmakefile \ lib/GNUmakefile lib/libtb/GNUmakefile \
...@@ -431,7 +431,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ ...@@ -431,7 +431,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tbsetup/startexp tbsetup/endexp tbsetup/webstartexp tbsetup/webendexp \ tbsetup/startexp tbsetup/endexp tbsetup/webstartexp tbsetup/webendexp \
tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \ tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \
tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \ tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \
tbsetup/ns2ir/parse-ns \ tbsetup/ns2ir/parse-ns tbsetup/ns2ir/parse.proxy \
tbsetup/ns2ir/sim.tcl tbsetup/db2ns \ tbsetup/ns2ir/sim.tcl tbsetup/db2ns \
tbsetup/tbprerun tbsetup/tbswap tbsetup/tbend \ tbsetup/tbprerun tbsetup/tbswap tbsetup/tbend \
tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \ tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \
......
...@@ -21,7 +21,7 @@ sub usage() ...@@ -21,7 +21,7 @@ sub usage()
} }
my $optlist = "x:vd"; my $optlist = "x:vd";
my $fromxml = 0; my $fromxml = 0;
my $nowrite = 0; my $impotent = 0;
my $debug = 0; my $debug = 0;
# #
...@@ -56,14 +56,14 @@ my %virtual_tables = ("experiments" => undef, ...@@ -56,14 +56,14 @@ my %virtual_tables = ("experiments" => undef,
# The experiment table is special. Only certain fields are allowed to # The experiment table is special. Only certain fields are allowed to
# be updated. Not sure what the right approach for this is. # be updated. Not sure what the right approach for this is.
# #
my %experiment_fields = ("multiplex_factor" => 1, my %experiment_fields = ("multiplex_factor" => 1,
forcelinkdelays => 1, "forcelinkdelays" => 1,
uselinkdelays => 1, "uselinkdelays" => 1,
usewatunnels => 1, "usewatunnels" => 1,
uselatestwadata => 1, "uselatestwadata" => 1,
wa_delay_solverweight => 1, "wa_delay_solverweight" => 1,
wa_bw_solverweight => 1, "wa_bw_solverweight" => 1,
wa_plr_solverweight => 1); "wa_plr_solverweight" => 1);
# #
# Turn off line buffering on output # Turn off line buffering on output
...@@ -105,7 +105,7 @@ if (defined($options{"x"})) { ...@@ -105,7 +105,7 @@ if (defined($options{"x"})) {
fatal("Bad data in argument: $xmlfile."); fatal("Bad data in argument: $xmlfile.");
} }
if (defined($options{"n"})) { if (defined($options{"n"})) {
$nowrite = 1; $impotent = 1;
} }
} }
if (@ARGV != 2) { if (@ARGV != 2) {
...@@ -198,11 +198,15 @@ sub readXML($$$) { ...@@ -198,11 +198,15 @@ sub readXML($$$) {
if (! exists($virtual_tables{$tablename})) { if (! exists($virtual_tables{$tablename})) {
fatal("Unknown virtual table: $_"); fatal("Unknown virtual table: $_");
} }
# New table. Define a list. #
if (defined($virtual_tables{$tablename})) { # New table. Define a list. Note that the parser will spit
fatal("Duplicate virtual table: $_"); # out the table start/end tags multiple times, since the
# parser is written in such a way that its not possible to
# flatten it out. Thats okay.
#
if (! defined($virtual_tables{$tablename})) {
$virtual_tables{$tablename} = [];
} }
$virtual_tables{$tablename} = [];
print "Starting new table: $tablename\n" print "Starting new table: $tablename\n"
if ($debug); if ($debug);
...@@ -241,7 +245,7 @@ sub readXML($$$) { ...@@ -241,7 +245,7 @@ sub readXML($$$) {
# #
if ($1 ne "pid" && $1 ne "eid") { if ($1 ne "pid" && $1 ne "eid") {
$row->{$1} = xmldecode($2); $row->{$1} = xmldecode($2);
print " Entering new element: $1/$row->{$1}\n" print " Entering new element: $1: $row->{$1}\n"
if ($debug); if ($debug);
} }
} }
...@@ -286,49 +290,62 @@ sub readXML($$$) { ...@@ -286,49 +290,62 @@ sub readXML($$$) {
# #
# Okay, thats all the checking we do! There is not much that can # Okay, thats all the checking we do! There is not much that can
# screw up the DB, by inserting rows into the allowed set of tables. # screw up the DB just by inserting rows into the allowed set of
# virtual experiment tables, since we ignore the pid/eid in the xml.
# #
# First the experiments table, which gets an update. # First the experiments table, which gets an update statement, if there
# is anything to update.
# #
my @setlist = (); if (scalar(keys(%experiments_table))) {
foreach my $key (keys(%experiments_table)) { my @setlist = ();
$val = $experiments_table{$key};
if ($val eq "NULL") { foreach my $key (keys(%experiments_table)) {
push(@setlist, "$key=NULL"); my $val = $experiments_table{$key};
if ($val eq "NULL") {
push(@setlist, "$key=NULL");
}
else {
push(@setlist, "$key='$val'");
}
} }
else { my $query = "update experiments ".
push(@setlist, "$key='$val'"); "set " . join(",", @setlist) . " " .
} "where eid='$eid' and pid='$pid'";
print "$query\n"
if ($debug);
DBQueryFatal($query)
if (!$impotent);
} }
my $query = "update experiments ".
"set " . join(",", @setlist) . " " .
"where eid='$eid' and pid='$pid'";
print "$query\n"
if ($debug);
DBQueryFatal($query)
if (!$nowrite);
# #
# Now all the other tables, which get inserts. Need to delete all the # Now all the other tables, which get inserts. Need to delete all the
# old info too. # old info too.
# #
foreach my $table (keys(%virtual_tables)) { foreach my $table (keys(%virtual_tables)) {
# Don't want to muck with this table! Done above.
next
if ($table eq "experiments");
# Delete always.
DBQueryFatal("delete from $table ". DBQueryFatal("delete from $table ".
"where eid='$eid' and pid='$pid'") "where eid='$eid' and pid='$pid'")
if (!$nowrite); if (!$impotent);
next next
if (!defined($virtual_tables{$table})); if (!defined($virtual_tables{$table}));
next
if ($table eq "experiments");
foreach my $rowref (@{$virtual_tables{$table}}) { foreach my $rowref (@{$virtual_tables{$table}}) {
my %rowhash = %{ $rowref }; my %rowhash = %{ $rowref };
my @fields = ("pid", "eid"); my @fields = ("pid", "eid");
my @values = ("'$pid'", "'$eid'"); my @values = ("'$pid'", "'$eid'");
# If no actual rows, then skip. Might happen.
last
if (! scalar(keys(%rowhash)));
foreach my $key (keys(%rowhash)) { foreach my $key (keys(%rowhash)) {
$val = $rowhash{$key}; my $val = $rowhash{$key};
if ($val eq "NULL") { if ($val eq "NULL") {
push(@values, "NULL"); push(@values, "NULL");
...@@ -344,7 +361,7 @@ sub readXML($$$) { ...@@ -344,7 +361,7 @@ sub readXML($$$) {
print "$query\n" print "$query\n"
if ($debug); if ($debug);
DBQueryFatal($query) DBQueryFatal($query)
if (!$nowrite); if (!$impotent);
} }
} }
return 0; return 0;
......
...@@ -77,14 +77,20 @@ install: all script-install subdir-install ...@@ -77,14 +77,20 @@ install: all script-install subdir-install
# #
subdir-install: subdir-install:
@$(MAKE) -C checkpass install @$(MAKE) -C checkpass install
ifneq ($(OURDOMAIN),emulab.net)
@$(MAKE) -C ns2ir install @$(MAKE) -C ns2ir install
endif
script-install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_STUFF)) \ script-install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_STUFF)) \
$(addprefix $(INSTALL_SBINDIR)/, $(SBIN_STUFF)) \ $(addprefix $(INSTALL_SBINDIR)/, $(SBIN_STUFF)) \
$(addprefix $(INSTALL_LIBDIR)/, $(LIB_STUFF)) \ $(addprefix $(INSTALL_LIBDIR)/, $(LIB_STUFF)) \
$(addprefix $(INSTALL_LIBEXECDIR)/, $(LIBEXEC_STUFF)) $(addprefix $(INSTALL_LIBEXECDIR)/, $(LIBEXEC_STUFF)) \
$(addprefix $(INSTALL_DIR)/opsdir/lib/, libtestbed.pm)
post-install: post-install:
ifneq ($(OURDOMAIN),emulab.net)
@$(MAKE) -C ns2ir post-install
endif
chmod 775 $(INSTALL_BINDIR) chmod 775 $(INSTALL_BINDIR)
chmod 775 $(INSTALL_SBINDIR) chmod 775 $(INSTALL_SBINDIR)
chmod 775 $(INSTALL_LIBDIR) chmod 775 $(INSTALL_LIBDIR)
...@@ -138,6 +144,7 @@ control-install: $(addprefix $(INSTALL_SBINDIR)/, console_setup.proxy) \ ...@@ -138,6 +144,7 @@ control-install: $(addprefix $(INSTALL_SBINDIR)/, console_setup.proxy) \
$(addprefix $(INSTALL_SBINDIR)/, exports_setup.proxy) \ $(addprefix $(INSTALL_SBINDIR)/, exports_setup.proxy) \
$(addprefix $(INSTALL_SBINDIR)/, sfskey_update.proxy) \ $(addprefix $(INSTALL_SBINDIR)/, sfskey_update.proxy) \
$(addprefix $(INSTALL_LIBDIR)/, libtestbed.pm) $(addprefix $(INSTALL_LIBDIR)/, libtestbed.pm)
@$(MAKE) -C ns2ir control-install
$(LINKS) $(LINKS)
# #
...@@ -164,4 +171,7 @@ subdir-distclean: ...@@ -164,4 +171,7 @@ subdir-distclean:
%: %.tcl %: %.tcl
cp -p $< $@ cp -p $< $@
$(INSTALL_DIR)/opsdir/lib/%: %
@echo "Installing $<"
-mkdir -p $(INSTALL_DIR)/opsdir/lib
$(INSTALL) $< $@
...@@ -33,7 +33,7 @@ use lib "@prefix@/lib"; ...@@ -33,7 +33,7 @@ use lib "@prefix@/lib";
use libdb; use libdb;
use libtestbed; use libtestbed;
my $parser = "$TB/libexec/ns2ir/parse-ns"; my $parser = "$TB/libexec/parse-ns";
my $mkexpdir = "$TB/libexec/mkexpdir"; my $mkexpdir = "$TB/libexec/mkexpdir";
my $startexp = "$TB/bin/startexp"; my $startexp = "$TB/bin/startexp";
my $tbdata = "tbdata"; my $tbdata = "tbdata";
......
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group. # Copyright (c) 2000-2003 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -14,21 +14,32 @@ SUBDIR = tbsetup/ns2ir ...@@ -14,21 +14,32 @@ SUBDIR = tbsetup/ns2ir
include $(OBJDIR)/Makeconf include $(OBJDIR)/Makeconf
LIB_STUFF = lanlink.tcl node.tcl sim.tcl tb_compat.tcl null.tcl \ LIB_STUFF = lanlink.tcl node.tcl sim.tcl tb_compat.tcl null.tcl \
nsobject.tcl traffic.tcl vtype.tcl parse.tcl program.tcl \ nsobject.tcl traffic.tcl vtype.tcl parse.tcl program.tcl \
nsenode.tcl nstb_compat.tcl nsenode.tcl nstb_compat.tcl
LIBEXEC_STUFF = parse-ns BOSSLIBEXEC = parse-ns
USERLIBEXEC = parse.proxy
# #
# Force dependencies on the scripts so that they will be rerun through # Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed. # configure if the .in file is changed.
# #
all: $(LIB_STUFF) $(LIBEXEC_STUFF) all: $(LIB_STUFF) $(BOSSLIBEXEC) $(USERLIBEXEC)
include $(TESTBED_SRCDIR)/GNUmakerules include $(TESTBED_SRCDIR)/GNUmakerules
install: $(addprefix $(INSTALL_LIBDIR)/ns2ir/, $(LIB_STUFF)) \ install: control-install \
$(addprefix $(INSTALL_LIBEXECDIR)/ns2ir/, $(LIBEXEC_STUFF)) $(addprefix $(INSTALL_LIBEXECDIR)/, $(BOSSLIBEXEC)) \
$(addprefix $(INSTALL_DIR)/opsdir/lib/ns2ir/, $(LIB_STUFF)) \
$(addprefix $(INSTALL_DIR)/opsdir/libexec/ns2ir/, $(USERLIBEXEC))
control-install: $(addprefix $(INSTALL_LIBDIR)/ns2ir/, $(LIB_STUFF)) \
$(addprefix $(INSTALL_LIBEXECDIR)/ns2ir/, $(USERLIBEXEC))
post-install:
chmod 775 $(INSTALL_LIBEXECDIR)
chown root $(INSTALL_LIBEXECDIR)/parse-ns
chmod u+s $(INSTALL_LIBEXECDIR)/parse-ns
$(INSTALL_LIBDIR)/ns2ir/%: % $(INSTALL_LIBDIR)/ns2ir/%: %
@echo "Installing $<" @echo "Installing $<"
...@@ -40,4 +51,14 @@ $(INSTALL_LIBEXECDIR)/ns2ir/%: % ...@@ -40,4 +51,14 @@ $(INSTALL_LIBEXECDIR)/ns2ir/%: %
-mkdir -p $(INSTALL_LIBEXECDIR)/ns2ir -mkdir -p $(INSTALL_LIBEXECDIR)/ns2ir
$(INSTALL) $< $@ $(INSTALL) $< $@
$(INSTALL_DIR)/opsdir/lib/ns2ir/%: %
@echo "Installing $<"
-mkdir -p $(INSTALL_DIR)/opsdir/lib/ns2ir
$(INSTALL) $< $@
$(INSTALL_DIR)/opsdir/libexec/ns2ir/%: %
@echo "Installing $<"
-mkdir -p $(INSTALL_DIR)/opsdir/libexec/ns2ir
$(INSTALL) $< $@
clean: clean:
...@@ -384,7 +384,6 @@ LanLink instproc rename_node {old new} { ...@@ -384,7 +384,6 @@ LanLink instproc rename_node {old new} {
} }
Link instproc updatedb {DB} { Link instproc updatedb {DB} {
$self next $DB
$self instvar toqueue $self instvar toqueue
$self instvar fromqueue $self instvar fromqueue
$self instvar nodelist $self instvar nodelist
...@@ -392,6 +391,19 @@ Link instproc updatedb {DB} { ...@@ -392,6 +391,19 @@ Link instproc updatedb {DB} {
$self instvar trivial_ok $self instvar trivial_ok
var_import ::GLOBALS::pid var_import ::GLOBALS::pid
var_import ::GLOBALS::eid var_import ::GLOBALS::eid
$self instvar bandwidth
$self instvar rbandwidth
$self instvar delay
$self instvar rdelay
$self instvar loss
$self instvar rloss
$self instvar cost
$self instvar widearea
$self instvar uselinkdelay
$self instvar emulated
$self instvar nobwshaping
$self instvar useveth
$self instvar sim
foreach nodeport $nodelist { foreach nodeport $nodelist {
set node [lindex $nodeport 0] set node [lindex $nodeport 0]
...@@ -435,17 +447,34 @@ Link instproc updatedb {DB} { ...@@ -435,17 +447,34 @@ Link instproc updatedb {DB} {
set droptail_ [$linkqueue set drop-tail_] set droptail_ [$linkqueue set drop-tail_]
set nodeportraw [join $nodeport ":"] set nodeportraw [join $nodeport ":"]
sql exec $DB "update virt_lans set q_limit=$limit_, q_maxthresh=$maxthresh_, q_minthresh=$thresh_, q_weight=$q_weight_, q_linterm=$linterm_, q_qinbytes=${queue-in-bytes_}, q_bytes=$bytes_, q_meanpsize=$mean_pktsize_, q_wait=$wait_, q_setbit=$setbit_, q_droptail=$droptail_, q_red=$red_, q_gentle=$gentle_, trivial_ok=$trivial_ok where pid=\"$pid\" and eid=\"$eid\" and vname=\"$self\" and member=\"$nodeportraw\""
set fields [list "vname" "member" "delay" "rdelay" "bandwidth" "rbandwidth" "lossrate" "rlossrate" "cost" "widearea" "emulated" "uselinkdelay" "nobwshaping" "usevethiface" "q_limit" "q_maxthresh" "q_minthresh" "q_weight" "q_linterm" "q_qinbytes" "q_bytes" "q_meanpsize" "q_wait" "q_setbit" "q_droptail" "q_red" "q_gentle" "trivial_ok"]
set values [list $self $nodeportraw $delay($nodeport) $rdelay($nodeport) $bandwidth($nodeport) $rbandwidth($nodeport) $loss($nodeport) $rloss($nodeport) $cost($nodeport) $widearea $emulated $uselinkdelay $nobwshaping $useveth $limit_ $maxthresh_ $thresh_ $q_weight_ $linterm_ ${queue-in-bytes_} $bytes_ $mean_pktsize_ $wait_ $setbit_ $droptail_ $red_ $gentle_ $trivial_ok]
$sim spitxml_data "virt_lans" $fields $values
} }
} }
Lan instproc updatedb {DB} { Lan instproc updatedb {DB} {
$self next $DB
$self instvar nodelist $self instvar nodelist
$self instvar linkq $self instvar linkq
$self instvar trivial_ok $self instvar trivial_ok
var_import ::GLOBALS::pid var_import ::GLOBALS::pid
var_import ::GLOBALS::eid var_import ::GLOBALS::eid
$self instvar bandwidth
$self instvar rbandwidth
$self instvar delay
$self instvar rdelay
$self instvar loss
$self instvar rloss
$self instvar cost
$self instvar widearea
$self instvar uselinkdelay
$self instvar emulated
$self instvar nobwshaping
$self instvar useveth
$self instvar sim
foreach nodeport $nodelist { foreach nodeport $nodelist {
set node [lindex $nodeport 0] set node [lindex $nodeport 0]
...@@ -490,31 +519,12 @@ Lan instproc updatedb {DB} { ...@@ -490,31 +519,12 @@ Lan instproc updatedb {DB} {
set droptail_ [$linkqueue set drop-tail_] set droptail_ [$linkqueue set drop-tail_]
set nodeportraw [join $nodeport ":"] set nodeportraw [join $nodeport ":"]
sql exec $DB "update virt_lans set q_limit=$limit_, q_maxthresh=$maxthresh_, q_minthresh=$thresh_, q_weight=$q_weight_, q_linterm=$linterm_, q_qinbytes=${queue-in-bytes_}, q_bytes=$bytes_, q_meanpsize=$mean_pktsize_, q_wait=$wait_, q_setbit=$setbit_, q_droptail=$droptail_, q_red=$red_, q_gentle=$gentle_, trivial_ok=$trivial_ok where pid=\"$pid\" and eid=\"$eid\" and vname=\"$self\" and member=\"$nodeportraw\""
}
}
# updatedb DB set fields [list "vname" "member" "delay" "rdelay" "bandwidth" "rbandwidth" "lossrate" "rlossrate" "cost" "widearea" "emulated" "uselinkdelay" "nobwshaping" "usevethiface" "q_limit" "q_maxthresh" "q_minthresh" "q_weight" "q_linterm" "q_qinbytes" "q_bytes" "q_meanpsize" "q_wait" "q_setbit" "q_droptail" "q_red" "q_gentle" "trivial_ok"]
# This adds a row to the virt_lans table.
LanLink instproc updatedb {DB} { set values [list $self $nodeportraw $delay($nodeport) $rdelay($nodeport) $bandwidth($nodeport) $rbandwidth($nodeport) $loss($nodeport) $rloss($nodeport) $cost($nodeport) $widearea $emulated $uselinkdelay $nobwshaping $useveth $limit_ $maxthresh_ $thresh_ $q_weight_ $linterm_ ${queue-in-bytes_} $bytes_ $mean_pktsize_ $wait_ $setbit_ $droptail_ $red_ $gentle_ $trivial_ok]
$self instvar nodelist
$self instvar bandwidth
$self instvar rbandwidth
$self instvar delay
$self instvar rdelay
$self instvar loss
$self instvar rloss
$self instvar cost
$self instvar widearea
$self instvar uselinkdelay
$self instvar emulated
$self instvar nobwshaping
$self instvar useveth
var_import ::GLOBALS::pid
var_import ::GLOBALS::eid
foreach nodeport $nodelist { $sim spitxml_data "virt_lans" $fields $values
set nodeportraw [join $nodeport ":"]
sql exec $DB "insert into virt_lans (pid,eid,vname,member,delay,rdelay,bandwidth,rbandwidth,lossrate,rlossrate,cost,widearea,emulated,uselinkdelay,nobwshaping,usevethiface) values (\"$pid\",\"$eid\",\"$self\",\"$nodeportraw\",$delay($nodeport),$rdelay($nodeport),$bandwidth($nodeport),$rbandwidth($nodeport),$loss($nodeport),$rloss($nodeport),$cost($nodeport),$widearea,$emulated,$uselinkdelay,$nobwshaping,$useveth)"
} }
} }
...@@ -124,6 +124,7 @@ Node instproc updatedb {DB} { ...@@ -124,6 +124,7 @@ Node instproc updatedb {DB} {
$self instvar realtime $self instvar realtime
$self instvar isvirt $self instvar isvirt
$self instvar virthost $self instvar virthost
var_import ::TBCOMPAT::default_osids
var_import ::GLOBALS::pid var_import ::GLOBALS::pid
var_import ::GLOBALS::eid var_import ::GLOBALS::eid
var_import ::GLOBALS::default_ip_routing_type var_import ::GLOBALS::default_ip_routing_type
...@@ -132,12 +133,10 @@ Node instproc updatedb {DB} { ...@@ -132,12 +133,10 @@ Node instproc updatedb {DB} {
# If we haven't specified a osid so far then we should fill it # If we haven't specified a osid so far then we should fill it
# with the id from the node_types table now. # with the id from the node_types table now.
if {$osid == {}} { if {$osid == {}} {
if {$virthost} { if {$virthost == 0} {
set osid "FBSD-STD" if {[info exists default_osids($type)]} {
} else { set osid $default_osids($type)
sql query $DB "select osid from node_types where type = \"$type\"" }
set osid [sql fetchrow $DB]
sql endquery $DB
} }
} else { } else {
# Do not allow user to set os for virt nodes at this time. # Do not allow user to set os for virt nodes at this time.
...@@ -167,7 +166,7 @@ Node instproc updatedb {DB} { ...@@ -167,7 +166,7 @@ Node instproc updatedb {DB} {
$self add_routes_to_DB $DB $self add_routes_to_DB $DB
# Update the DB # Update the DB
sql exec $DB "insert into virt_nodes (pid,eid,vname,type,ips,osname,cmd_line,rpms,deltas,startupcmd,tarfiles,failureaction,routertype,fixed) values (\"$pid\",\"$eid\",\"$self\",\"$type\",\"$ipraw\",\"$osid\",\"$cmdline\",\"$rpms\",\"$deltas\",\"$startup\",\"$tarfiles\",\"$failureaction\",\"$default_ip_routing_type\",\"$fixed\")"; $sim spitxml_data "virt_nodes" [list "vname" "type" "ips" "osname" "cmd_line" "rpms" "deltas" "startupcmd" "tarfiles" "failureaction" "routertype" "fixed" ] [list $self $type $ipraw $osid $cmdline $rpms $deltas $startup $tarfiles $failureaction $default_ip_routing_type $fixed ]
} }
# add_lanlink lanlink # add_lanlink lanlink
...@@ -353,7 +352,6 @@ Node instproc add_routes_to_DB {DB} { ...@@ -353,7 +352,6 @@ Node instproc add_routes_to_DB {DB} {
return return
} }
} }
$sim spitxml_data "virt_routes" [list "vname" "dst" "nexthop" "dst_type" ] [list $self $dstip $hopip $type ]
sql exec $DB "insert into virt_routes (pid,eid,vname,dst,nexthop,dst_type) values ('$pid','$eid','$self','$dstip','$hopip','$type')";
} }
} }
#!/usr/bin/perl -w #!/usr/bin/perl -wT
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group. # Copyright (c) 2000-2003 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #