Commit 91f5cb5c authored by Gary Wong's avatar Gary Wong

Handle direct links when nodes are mapped in reverse order.

parent 413743fe
......@@ -4913,6 +4913,30 @@ sub ReadTextSolution($$)
$nodeportB =~ s/\//:/;
($nodeB,$portB) = split(":", $nodeportB);
}
if( $direct ) {
# Ensure the mapping of direct links is in the same order
# as the virt members...
my ($vlinktype, $vlinkname, $vlinkmembers) = split( "/", $vlink );
my ($vmem0, $vmem1) = split( ",", $vlinkmembers );
my ($vmem0node, $vmem0port) = split( ":", $vmem0 );
my $mapped0 = $self->solution_v2p()->{ $vmem0node };
if( $mapped0 eq $nodeB ) {
# It isn't. Flip the order of the nodes to avoid
# horrible confusion later.
my ($nodeT, $portT);
$nodeT = $nodeB;
$portT = $portB;
$nodeB = $nodeA;
$portB = $portA;
$nodeA = $nodeT;
$portA = $portT;
}
}
}
$self->AddLinkToSolution($vlink, $trivial, $direct,
$nodeA, $portA, $nodeB, $portB, $swpath);
......
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