Commit 257078f0 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

More little changes for mapper regression mode so that

physical state compares properly. Also some actual fixes.
parent d6fafc70
...@@ -1597,8 +1597,8 @@ if ($needwanassign) { ...@@ -1597,8 +1597,8 @@ if ($needwanassign) {
# is on the real node. We know they are free, but we should go through # is on the real node. We know they are free, but we should go through
# nalloc anyway. If anything fails, no point in retry. # nalloc anyway. If anything fails, no point in retry.
# #
foreach my $pnode (keys(%virtnodes)) { foreach my $pnode (sort(keys(%virtnodes))) {
my @vlist = @{$virtnodes{$pnode}}; my @vlist = sort(@{$virtnodes{$pnode}});
my $numvs = @vlist; my $numvs = @vlist;
my @plist = (); my @plist = ();
my @oplist = (); my @oplist = ();
...@@ -1692,6 +1692,7 @@ foreach my $pnode (keys(%virtnodes)) { ...@@ -1692,6 +1692,7 @@ foreach my $pnode (keys(%virtnodes)) {
"vtype" => $vtype, "vtype" => $vtype,
"nodeid" => $pnode, "nodeid" => $pnode,
"verbose" => $verbose, "verbose" => $verbose,
"regression" => $regression,
"impotent" => $impotent}) < 0) { "impotent" => $impotent}) < 0) {
fatal("Could not allocate vnodes on $pnode"); fatal("Could not allocate vnodes on $pnode");
} }
...@@ -2609,7 +2610,7 @@ foreach $vnodeport (keys(%portbw)) { ...@@ -2609,7 +2610,7 @@ foreach $vnodeport (keys(%portbw)) {
# to be just one jail per node, but thats not likely in the local area case. # to be just one jail per node, but thats not likely in the local area case.
# What would be the point. # What would be the point.
# #
foreach my $vnode (keys(%v2pmap)) { foreach my $vnode (sort(keys(%v2pmap))) {
my $pnode = $v2pmap{$vnode}; my $pnode = $v2pmap{$vnode};
my $vvnode = $v2vmap{$vnode}; my $vvnode = $v2vmap{$vnode};
...@@ -4201,8 +4202,7 @@ sub LoadVirtLans() ...@@ -4201,8 +4202,7 @@ sub LoadVirtLans()
DBQueryFatal("select v.*,vll.idx from virt_lans as v ". DBQueryFatal("select v.*,vll.idx from virt_lans as v ".
"left join virt_lan_lans as vll on ". "left join virt_lan_lans as vll on ".
" vll.exptidx=v.exptidx and vll.vname=v.vname ". " vll.exptidx=v.exptidx and vll.vname=v.vname ".
"where v.pid='$pid' and v.eid='$eid' ". "where v.pid='$pid' and v.eid='$eid'");
"order by v.vname,v.member");
while (my $rowref = $query_result->fetchrow_hashref()) { while (my $rowref = $query_result->fetchrow_hashref()) {
my $vname = $rowref->{"vname"}; my $vname = $rowref->{"vname"};
...@@ -4550,7 +4550,7 @@ sub CreateTopFile() ...@@ -4550,7 +4550,7 @@ sub CreateTopFile()
print "opened topfile\n"; print "opened topfile\n";
# Print out vtypes # Print out vtypes
foreach my $vtype (keys(%virt_vtypes)) { foreach my $vtype (sort(keys(%virt_vtypes))) {
my $name = virttypename($vtype); my $name = virttypename($vtype);
my $weight = virttypeweight($vtype); my $weight = virttypeweight($vtype);
my @members= virttypemembers($vtype); my @members= virttypemembers($vtype);
...@@ -4559,7 +4559,7 @@ sub CreateTopFile() ...@@ -4559,7 +4559,7 @@ sub CreateTopFile()
} }
# Dump the node list to the topfile. # Dump the node list to the topfile.
foreach my $node (keys(%virt_nodes)) { foreach my $node (sort(keys(%virt_nodes))) {
my $vname = virtnodename($node); my $vname = virtnodename($node);
my $type = virtnodetype($node); my $type = virtnodetype($node);
...@@ -4639,7 +4639,7 @@ sub CreateTopFile() ...@@ -4639,7 +4639,7 @@ sub CreateTopFile()
} }
} }
foreach $lan (keys(%virt_lans)) { foreach $lan (sort(keys(%virt_lans))) {
# XXX Widearea Tunnels are handled elsewhere. # XXX Widearea Tunnels are handled elsewhere.
next next
if (virtlantunnel($lan)); if (virtlantunnel($lan));
...@@ -5079,7 +5079,7 @@ sub CreateTopFile() ...@@ -5079,7 +5079,7 @@ sub CreateTopFile()
my $plink = "linksimple/$lan/$nodeport0,$nodeport1"; my $plink = "linksimple/$lan/$nodeport0,$nodeport1";
print(TOPFILE "link $plink $node0 $node1 ". print(TOPFILE "link $plink $node0 $node1 ".
max($top_bw,$top_rbw) . " 0 0 $protocol " . max($top_bw,$top_rbw) . " 0 0 $protocol" .
($emulated ? " emulated" : "") . ($emulated ? " emulated" : "") .
($trivial_ok ? " trivial_ok" : "") . " $fixall\n"); ($trivial_ok ? " trivial_ok" : "") . " $fixall\n");
...@@ -5360,7 +5360,7 @@ sub CreateTopFile() ...@@ -5360,7 +5360,7 @@ sub CreateTopFile()
# experiment any more. # experiment any more.
# NB: This must be done last since we create internal nodes above. # NB: This must be done last since we create internal nodes above.
# #
foreach my $node (keys(%fixed_nodes)) { foreach my $node (sort(keys(%fixed_nodes))) {
if ((virtnodeisvnode($node) && !virtnodeusewan($node)) || if ((virtnodeisvnode($node) && !virtnodeusewan($node)) ||
exists($delaynodes{$node})) { exists($delaynodes{$node})) {
my $pnode = $fixed_nodes{$node}; my $pnode = $fixed_nodes{$node};
...@@ -5666,7 +5666,7 @@ sub nodejailosid($) ...@@ -5666,7 +5666,7 @@ sub nodejailosid($)
my $osid = virtnodeosid($vnode); my $osid = virtnodeosid($vnode);
my $nextosid = osidnextosid($osid); my $nextosid = osidnextosid($osid);
if (defined($nextosid)) { if (defined($nextosid)) {
printdb "Mapping jail osid to $osid ($nextosid) on $pnode\n"; printdb "Mapping jail osid $osid to $nextosid on $pnode ($vnode)\n";
} }
else { else {
tbwarn("Could not map jail osid to real osid on $pnode\n"); tbwarn("Could not map jail osid to real osid on $pnode\n");
...@@ -5686,7 +5686,8 @@ sub FinalizeRegression($) ...@@ -5686,7 +5686,8 @@ sub FinalizeRegression($)
chomp($cwd = `/bin/pwd`); chomp($cwd = `/bin/pwd`);
if (!$error) { if (!$error) {
print STDERR "Saving physical state in regression mode\n"; print STDERR "Saving physical state in regression mode\n";
if ($experiment->BackupPhysicalState("$cwd/$pid-$eid.pstate") != 0) { if ($experiment->BackupPhysicalState("$cwd/$pid-$eid.pstate", 1)
!= 0) {
print STDERR "Could not save physical state!\n"; print STDERR "Could not save physical state!\n";
exit(1); exit(1);
} }
......
...@@ -3009,7 +3009,7 @@ sub AllocNodes($) ...@@ -3009,7 +3009,7 @@ sub AllocNodes($)
# work unless there happens to be just one jail per node, but # work unless there happens to be just one jail per node, but
# thats not likely in the local area case. # thats not likely in the local area case.
# #
foreach my $vnodename (keys(%{ $self->solution_v2v() })) { foreach my $vnodename (sort(keys(%{ $self->solution_v2v() }))) {
my $vpnodename = $self->solution_v2v()->{$vnodename}; my $vpnodename = $self->solution_v2v()->{$vnodename};
my $vpnode = $self->pnodes()->{$vpnodename}; my $vpnode = $self->pnodes()->{$vpnodename};
...@@ -3187,7 +3187,8 @@ sub AllocVirtNodes($) ...@@ -3187,7 +3187,8 @@ sub AllocVirtNodes($)
"nodeid" => $physical, "nodeid" => $physical,
"debug" => 0, "debug" => 0,
"verbose" => $self->verbose(), "verbose" => $self->verbose(),
"impotent" => $self->impotent()}) "impotent" => $self->impotent(),
"regression" => $self->regression()})
< 0) { < 0) {
tberror("Could not allocate vnodes on $physical\n"); tberror("Could not allocate vnodes on $physical\n");
return -1; return -1;
...@@ -3929,6 +3930,8 @@ sub InitializePhysNode($$$) ...@@ -3929,6 +3930,8 @@ sub InitializePhysNode($$$)
%nodesets = ("def_boot_cmd_line" => $cmdline, %nodesets = ("def_boot_cmd_line" => $cmdline,
"startstatus" => 0, "startstatus" => 0,
"bootstatus" => 'unknown', "bootstatus" => 'unknown',
# This is no longer used for anything.
"deltas" => '',
"ready" => 0, "ready" => 0,
"routertype" => $routertype); "routertype" => $routertype);
...@@ -3969,6 +3972,8 @@ sub InitializePhysNode($$$) ...@@ -3969,6 +3972,8 @@ sub InitializePhysNode($$$)
%nodesets = ("def_boot_cmd_line" => $cmdline, %nodesets = ("def_boot_cmd_line" => $cmdline,
"startstatus" => 'none', "startstatus" => 'none',
"bootstatus" => 'unknown', "bootstatus" => 'unknown',
# This is no longer used for anything.
"deltas" => '',
"ready" => 0, "ready" => 0,
"startupcmd" => $startupcmd, "startupcmd" => $startupcmd,
"failureaction" => $failureaction, "failureaction" => $failureaction,
...@@ -4031,9 +4036,16 @@ sub nodejailosid($$$) ...@@ -4031,9 +4036,16 @@ sub nodejailosid($$$)
# osid cause of assign (osid features/desires). # osid cause of assign (osid features/desires).
# #
my $osinfo = $virtnode->_osinfo(); my $osinfo = $virtnode->_osinfo();
my $nextosid = $osinfo->nextosid(); return undef
if (!defined($osinfo->nextosid()));
$osinfo = $osinfo->ResolveNextOSID($self->experiment());
return undef
if (!defined($osinfo));
my $nextosid = $osinfo->osid();
if (defined($nextosid)) { if (defined($nextosid)) {
$self->printdb("Mapping jail osid to $nextosid on $pnode\n"); $self->printdb("Mapping jail osinfo $osinfo to ".
"$nextosid on $pnode ($virtnode)\n");
} }
else { else {
tbwarn("Could not map jail osid to real osid on $pnode\n"); tbwarn("Could not map jail osid to real osid on $pnode\n");
...@@ -5252,7 +5264,7 @@ sub SetPortRange($) ...@@ -5252,7 +5264,7 @@ sub SetPortRange($)
DBQueryWarn("update nodes set ipport_low=$newlow, ". DBQueryWarn("update nodes set ipport_low=$newlow, ".
" ipport_next=ipport_low+1, ipport_high=$newhigh ". " ipport_next=ipport_low+1, ipport_high=$newhigh ".
"where node_id='$vpnodename'") "where node_id='$vpnodename'")
or return -1 if ($self->impotent()); or return -1 if (!$self->impotent());
} }
return 0; return 0;
} }
......
...@@ -536,7 +536,8 @@ sub FinalizeRegression($) ...@@ -536,7 +536,8 @@ sub FinalizeRegression($)
chomp($cwd = `/bin/pwd`); chomp($cwd = `/bin/pwd`);
if (!$error) { if (!$error) {
chat("Saving physical state in regression mode\n"); chat("Saving physical state in regression mode\n");
if ($experiment->BackupPhysicalState("$cwd/$pid-$eid.pstate") != 0) { if ($experiment->BackupPhysicalState("$cwd/$pid-$eid.pstate", 1)
!= 0) {
print STDERR "Could not save physical state!\n"; print STDERR "Could not save physical state!\n";
exit(1); exit(1);
} }
......
Markdown is supported
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