Commit f431687a authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Minor debugging tweaks to catch swapmod/vlan problems.

parent 8f46ce3a
...@@ -3195,6 +3195,27 @@ sub ClearBackupState($) ...@@ -3195,6 +3195,27 @@ sub ClearBackupState($)
return 0; return 0;
} }
sub SaveBackupState($)
{
my ($self) = @_;
# Must be a real reference.
return -1
if (! ref($self));
my $pid = $self->pid();
my $eid = $self->eid();
my $workdir = $self->WorkDir();
my $pstateDir = $workdir . "/pstate";
my $vstateDir = $workdir . "/vstate";
system("/bin/cp -Rfp $pstateDir ${pstateDir}-prev")
if (-e $pstateDir);
system("/bin/cp -Rfp $vstateDir ${vstateDir}-prev")
if (-e $vstateDir);
return 0;
}
sub RemovePhysicalState($;$) sub RemovePhysicalState($;$)
{ {
my ($self, $purge) = @_; my ($self, $purge) = @_;
...@@ -3373,6 +3394,11 @@ sub BackupPhysicalState($;$$) ...@@ -3373,6 +3394,11 @@ sub BackupPhysicalState($;$$)
"order by node_id,unit ". "order by node_id,unit ".
"into outfile '$pstateDir/vinterfaces' ") "into outfile '$pstateDir/vinterfaces' ")
or $errors++; or $errors++;
# Just for debugging.
DBQueryWarn("SELECT * FROM vlans WHERE pid='$pid' AND eid='$eid' ".
"INTO OUTFILE '$pstateDir/vlans' ")
or $errors++;
return $errors; return $errors;
} }
......
...@@ -1066,7 +1066,12 @@ sub opPortVlan($$$@) { ...@@ -1066,7 +1066,12 @@ sub opPortVlan($$$@) {
my %BumpedVlans = (); my %BumpedVlans = ();
foreach my $port (@ports) { foreach my $port (@ports) {
$self->debug("Putting port ".Port->toStrings(($port))." in VLAN $vlan_number\n"); if ($remove) {
$self->debug("Removing port $port from VLAN $vlan_number\n");
}
else {
$self->debug("Putting port $port in VLAN $vlan_number\n");
}
# #
# Check to see if it's a trunk .... # Check to see if it's a trunk ....
# #
......
...@@ -1435,8 +1435,10 @@ sub cleanup() ...@@ -1435,8 +1435,10 @@ sub cleanup()
if ($inout eq "modify") { if ($inout eq "modify") {
# #
# Clear backup state since not needed anymore; experiment is toast. # Clear backup state since not needed anymore; experiment is toast,
# but lets save a copy for post mortem.
# #
$experiment->SaveBackupState();
$experiment->ClearBackupState(); $experiment->ClearBackupState();
# #
......
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