From d7262006c32ab663b7bd1ba09d5a72caa3a6f429 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Fri, 24 Feb 2012 06:45:38 +0000 Subject: [PATCH] update 'mkhwconn -t' to support all ports in trunk git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11672 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/FSPconn.pm | 22 ++++++++++++++-------- xCAT-client/pods/man1/mkhwconn.1.pod | 4 ++-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/perl-xCAT/xCAT/FSPconn.pm b/perl-xCAT/xCAT/FSPconn.pm index 527a16053..65fbe9aea 100644 --- a/perl-xCAT/xCAT/FSPconn.pm +++ b/perl-xCAT/xCAT/FSPconn.pm @@ -222,14 +222,16 @@ sub mkhwconn_parse_args if( ! exists $opt{port} ) { - $opt{port} = "0"; - } - - if( $opt{port} ne "0" and $opt{port} ne "1") + $opt{port} = "[0|1]"; + } elsif( $opt{port} ne "0" and $opt{port} ne "1") { - return( usage('Wrong value of --port option. The value can be 0 or 1, and the default value is 0.')); + if ($opt{port} eq "0,1") { + return ([0, "The option --port only be used to specify special port value, please don't specify this value if you want to use all ports."]); + } else { + return( usage('Wrong value of --port option. The value can only be 0 or 1.')); + } } - + $ppctab->close(); #$nodetypetab->close(); $vpdtab->close(); @@ -613,7 +615,7 @@ sub lshwconn # push @value, [$node_name, $values, $Rc]; # next; # } - + my %rec = (); my @data_a = split("\n", $values); foreach my $data(@data_a) { if( $data =~ /state/) { @@ -627,7 +629,11 @@ sub lshwconn my $slot = $5; my $ipadd = $6; my $alt_ipaddr = $7; - $data = "$ipadd: $sp,ipadd=$ipadd,alt_ipadd=$alt_ipaddr,state=$state"; + if (exists($rec{$slot})) { + next; + } + $rec{$slot} = 1; + $data = "$sp,ipadd=$ipadd,alt_ipadd=$alt_ipaddr,state=$state"; } push @value, [$node_name, $data, $Rc]; } diff --git a/xCAT-client/pods/man1/mkhwconn.1.pod b/xCAT-client/pods/man1/mkhwconn.1.pod index bc0e0ef34..0f47b3668 100644 --- a/xCAT-client/pods/man1/mkhwconn.1.pod +++ b/xCAT-client/pods/man1/mkhwconn.1.pod @@ -41,7 +41,7 @@ Note: If a CEC belongs to a frame, which has a BPA installed, this CEC should no For PPC (using Direct FSP Management) specific: -It is used to set up connections for CEC and Frame node to Hardware Server on management node (or service node ). It only could be done according to the node definition in xCAT DB. And this command will try to read the user/password from the ppcdirect table firstly. If fails, then read them from passwd table. Commonly , the username is B. If using the B table, each CEC/Frame and user/password should be stored in B table. If using the B table, the key should be "B" or "B", and the related user/password are stored in B table. +It is used to set up connections for CEC and Frame node to Hardware Server on management node (or service node ). It only could be done according to the node definition in xCAT DB. And this command will try to read the user/password from the ppcdirect table first. If fails, then read them from passwd table. Commonly , the username is B. If using the B table, each CEC/Frame and user/password should be stored in B table. If using the B table, the key should be "B" or "B", and the related user/password are stored in B table. When B<--port> is specified, this command will create the connections for CECs/Frames whose side in B table is equal to port value. @@ -72,7 +72,7 @@ The tooltype is used to communicate to the CEC/Frame. The value could be B =item B<--port> -The port value specify which side will be used to create the connection to the CEC/Frame. The value could be "B<0>" or "B<1>". If this port value is not specfied in the command, it will use the default value "B<0>". If the port value is "B<0>", in the vpd table, the side column should be B and B; If the port value is "B<1>", the side column should be B and B. When making hardware connection between CEC/Frame and HMC, the port is used to specify the fsp/bpa port of the cec/frame. +The port value specifies which special side will be used to create the connection to the CEC/Frame. The value could only be specified as "B<0>" or "B<1>" and the default value is "B<0,1>". If the user wants to use all ports to create the connection, he should not specify this value. If the port value is specified as "B<0>", in the vpd table, the side column should be B and B; If the port value is specified as "B<1>", the side column should be B and B. When making hardware connection between CEC/Frame and HMC, the value is used to specify the fsp/bpa port of the cec/frame and will be organized in order of "B". If any side does not exist, the side would simply be ignored. Generally, only one port of a fsp/bap can be connected while another port be used as backup. =item B<-s>