From 794f22057ad192e87dfb2366fe327d4880b69ca6 Mon Sep 17 00:00:00 2001 From: jjhua Date: Sat, 28 Apr 2012 09:25:12 +0000 Subject: [PATCH] performance enhancement for getIPaddress() in FIP.pm; some other performace issues will be fixed later. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12388 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/FIP.pm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/FIP.pm b/xCAT-server/lib/xcat/plugins/FIP.pm index 74994c665..cf41ad33b 100644 --- a/xCAT-server/lib/xcat/plugins/FIP.pm +++ b/xCAT-server/lib/xcat/plugins/FIP.pm @@ -320,13 +320,24 @@ sub swapnodes xCAT::MsgUtils->message("E", $rsp, $callback); return 1; } - + my ($current_ppc_ent) = $ppctab->getNodeAttribs( $current_node,@ppcattribs); my ($fip_ppc_ent) = $ppctab->getNodeAttribs( $fip_node,@ppcattribs); my @current_attrs; my @fip_attrs; my $cec; if( $current_ppc_ent->{'parent'} eq $fip_ppc_ent->{'parent'} ) { + + my %tabs; + $tabs{ppc}=$ppctab; + $tabs{vpd}= xCAT::Table->new( 'vpd', -create=>1, -autocommit=>0); + unless ( !exists( $tabs{vpd} ) ) { + $rsp->{data}->[0] = "Cannot open vpd table"; + xCAT::MsgUtils->message("E", $rsp, $callback); + return 1; + } + + xCAT::FSPUtils::getHcpAttribs($request, \%tabs); #the attributes of the current LPAR will be used for fsp_api_action push @current_attrs, $current_ppc_ent->{'id'}; push @current_attrs, "0"; @@ -348,7 +359,7 @@ sub swapnodes my $type = "lpar"; $action = "all_lpars_state"; - my $values = xCAT::FSPUtils::fsp_state_action ($cec, $type, $action); + my $values = xCAT::FSPUtils::fsp_state_action ($request, $cec, \@current_attrs, $action); my $Rc = shift(@$values); if ( $Rc != 0 ) { $rsp->{data}->[0] = $$values[0]; @@ -427,7 +438,7 @@ sub swapnodes if( $current_ppc_ent->{'parent'} eq $fip_ppc_ent->{'parent'} ) { $action = "get_io_slot_info"; - $values = xCAT::FSPUtils::fsp_api_action ($cec, \@current_attrs, $action); + $values = xCAT::FSPUtils::fsp_api_action ($request,$cec, \@current_attrs, $action); #$Rc = shift(@$values); $Rc = pop(@$values); if ( $Rc != 0 ) { @@ -442,7 +453,7 @@ sub swapnodes foreach my $v (@data) { my ($lpar_id, $busid, $location, $drc_index, $owner_type, $owner, $descr) = split(/,/, $v); if( $lpar_id eq $current_ppc_ent->{'id'} ) { - $vals = xCAT::FSPUtils::fsp_api_action ($fip_node, \@fip_attrs, $action, $tooltype, $drc_index); + $vals = xCAT::FSPUtils::fsp_api_action ($request, $fip_node, \@fip_attrs, $action, $tooltype, $drc_index); $Rc = pop(@$vals); if ( $Rc != 0 ) { $rsp->{data}->[0] = $$vals[1];