From fcb1fc89138ac51c3d56f7ee8b3cb198db52edff Mon Sep 17 00:00:00 2001 From: wuzhy Date: Mon, 4 Jan 2010 03:55:09 +0000 Subject: [PATCH] adjust the argument of rmvm according to the requirement. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4868 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/PPCvm.pm | 48 +++++++++++++++++++++++------------------ perl-xCAT/xCAT/Usage.pm | 2 +- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/perl-xCAT/xCAT/PPCvm.pm b/perl-xCAT/xCAT/PPCvm.pm index 64260fb29..37c0e25d7 100644 --- a/perl-xCAT/xCAT/PPCvm.pm +++ b/perl-xCAT/xCAT/PPCvm.pm @@ -379,7 +379,7 @@ sub rmvm_parse_args { $Getopt::Long::ignorecase = 0; Getopt::Long::Configure( "bundling" ); - if ( !GetOptions( \%opt, qw(V|verbose) )) { + if ( !GetOptions( \%opt, qw(V|verbose service) )) { return( usage() ); } #################################### @@ -669,27 +669,33 @@ sub remove { my $lparinfo = shift(@lpars); my ($name,$id) = split /,/, $lparinfo; my $mtms = @$d[2]; - my $service_lparid = xCAT::PPCcli::lssyscfg( - $exp, - "fsp", - $mtms, - "service_lpar_id" ); - my $Rc = shift(@$service_lparid); - ##################################################### - # Change the CEC's state to standby and set it's service lpar id to none - ##################################################### - if ( $Rc == SUCCESS ) { - my $cfgdata = @$service_lparid[0]; - if ( ($id == $cfgdata) && ($cfgdata !~ /none/) ) { - $cfgdata = "service_lpar_id=none"; - my $result = xCAT::PPCcli::chsyscfg( $exp, "sys", $d, $cfgdata ); - $Rc = shift(@$result); - if ( $Rc != SUCCESS ) { - return( [[$lpar, @$service_lparid[0], $Rc]] ); - } - } - } + if ($opt->{service}) { + ############################################### + # begin to retrieve the CEC's service lpar id + ############################################### + my $service_lparid = xCAT::PPCcli::lssyscfg( + $exp, + "fsp", + $mtms, + "service_lpar_id" ); + my $Rc = shift(@$service_lparid); + + ##################################################### + # Change the CEC's state to standby and set it's service lpar id to none + ##################################################### + if ( $Rc == SUCCESS ) { + my $cfgdata = @$service_lparid[0]; + if ( ($id == $cfgdata) && ($cfgdata !~ /none/) ) { + $cfgdata = "service_lpar_id=none"; + my $result = xCAT::PPCcli::chsyscfg( $exp, "sys", $d, $cfgdata ); + $Rc = shift(@$result); + if ( $Rc != SUCCESS ) { + return( [[$lpar, @$service_lparid[0], $Rc]] ); + } + } + } + } ################################ # id profile mtms hcp type frame diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 98b110fa2..fe9c5efbd 100644 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -139,7 +139,7 @@ my %usage = ( chvm [-h|--help|-v|--version] chvm = [=...]", "rmvm" => -"Usage: rmvm [-V|--verbose] +"Usage: rmvm [--service][-V|--verbose] rmvm [-h|--help|-v|--version]", "lsslp" => "Usage: lsslp [-h|--help|-v|--version]