From 526035cf86989c65b5ae5a42ca9d4f898bced9c5 Mon Sep 17 00:00:00 2001 From: jjhua Date: Mon, 13 Jun 2011 01:31:23 +0000 Subject: [PATCH] fixed bug 3314548, modified lsvm's message when cec in power off state git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9785 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/FSPvm.pm | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/perl-xCAT/xCAT/FSPvm.pm b/perl-xCAT/xCAT/FSPvm.pm index d4f5af677..391b48e33 100644 --- a/perl-xCAT/xCAT/FSPvm.pm +++ b/perl-xCAT/xCAT/FSPvm.pm @@ -704,12 +704,13 @@ sub enumerate { $td[4]="fsp"; my $action = "get_io_slot_info"; my $values = xCAT::FSPUtils::fsp_api_action ($cec, \@td, $action); - my $Rc = shift(@$values); + #my $Rc = shift(@$values); + my $Rc = @$values[2]; if ( $Rc != 0 ) { - return( [$Rc,@$values[0]] ); - } - - $outhash{ 0 } = $$values[0]; + $outhash{ 1 } = "The LPARs' I/O slots information could NOT be listed because the cec is in power off state"; + } else { + $outhash{ 0 } = $$values[1]; + } #my @t; #foreach my $value ( @$values ) { # my ($lparid, $busid, $slot_location_code, $drc_index,@t ) = split (/,/, $value); @@ -760,6 +761,7 @@ sub list { my $Rc = shift(@$info); my $data = @$info[0]; my $values = $data->{0}; + my $msg = $data->{1}; while (($node_name,$d) = each(%$h) ) { my $cec = @$d[3]; @@ -777,17 +779,21 @@ sub list { # next; # } - # get the I/O slot information - my $v; - my @t; - my @value = split(/\n/, $values); - foreach my $v (@value) { - my ($lparid, @t ) = split (/,/, $v); - if ($type=~/^(fsp|cec)$/) { - push @result,[$lparid, join('/', @t), $Rc]; - } else { - if( $lparid eq $id) { + if( defined($msg)) { + push @result,[$node_name, $msg, 0]; + } else { + # get the I/O slot information + my $v; + my @t; + my @value = split(/\n/, $values); + foreach my $v (@value) { + my ($lparid, @t ) = split (/,/, $v); + if ($type=~/^(fsp|cec)$/) { push @result,[$lparid, join('/', @t), $Rc]; + } else { + if( $lparid eq $id) { + push @result,[$lparid, join('/', @t), $Rc]; + } } } }