Skip to content

Commit

Permalink
fix issue:rinstall plugin bug when setup SN on sles12.2 ppc64le #3466;…
Browse files Browse the repository at this point in the history
…fix issue [FVT] rinstall will hung when it failed to terminate sub process with SIGKILL #3094 (#3507)
  • Loading branch information
immarvin authored and robin2008 committed Jul 19, 2017
1 parent 8e6fdfd commit 970be4a
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions xCAT-server/lib/xcat/plugins/kvm.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3153,7 +3153,12 @@ sub power {
$allnodestatus{$node} = $::STATUS_POWERING_ON;
}
} elsif (not $dom->is_active()) {
$dom->create();
eval{
$dom->create();
};
if($@){
return (1, "Error: $@");
}
$allnodestatus{$node} = $::STATUS_POWERING_ON;
} else {
$retstring .= "$status_noop";
Expand All @@ -3163,7 +3168,12 @@ sub power {
my $newxml = $dom->get_xml_description();
$updatetable->{kvm_nodedata}->{$node}->{xml} = $newxml;
if ($dom->is_active()) {
$dom->destroy();
eval{
$dom->destroy();
};
if($@){
return (1, "Error: $@");
}
$allnodestatus{$node} = $::STATUS_POWERING_OFF;
}
undef $dom;
Expand All @@ -3185,7 +3195,10 @@ sub power {
if ($newxml) { #need to destroy and repower..
$updatetable->{kvm_nodedata}->{$node}->{xml} = $newxml;
my $persist = $dom->is_persistent();
$dom->destroy();
eval {$dom->destroy();};
if($@){
return (1, "Error: $@");
}
$allnodestatus{$node} = $::STATUS_POWERING_OFF;
if ($persist) { $dom->undefine(); }
undef $dom;
Expand Down Expand Up @@ -4176,7 +4189,9 @@ sub dohyp {
$desc =~ s/^\s+//;
$desc =~ s/\s+$//;
if ($desc) {
$output{node}->[0]->{data}->[0]->{desc}->[0] = $desc;
if($rc == 0){
$output{node}->[0]->{data}->[0]->{desc}->[0] = $desc;
}
}
}
$text =~ s/^\s+//;
Expand All @@ -4186,7 +4201,7 @@ sub dohyp {
if ($rc == 0) {
$output{node}->[0]->{data}->[0]->{contents}->[0] = $text;
} else {
$output{node}->[0]->{error} = $text;
$output{node}->[0]->{error}->[0] = $text;
}

if ($command eq 'rpower') {
Expand Down

0 comments on commit 970be4a

Please sign in to comment.