mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 11:22:27 +00:00 
			
		
		
		
	Initial commit to support rpower softoff for openbmc
This commit is contained in:
		| @@ -45,7 +45,7 @@ OpenPOWER OpenBMC: | ||||
| ================== | ||||
|  | ||||
|  | ||||
| \ **rpower**\  \ *noderange*\  [\ **off | on | reset | boot | stat | state | status**\ ] | ||||
| \ **rpower**\  \ *noderange*\  [\ **off | on | softoff | reset | boot | stat | state | status**\ ] | ||||
|  | ||||
|  | ||||
| PPC (with IVM or HMC) specific: | ||||
|   | ||||
| @@ -22,7 +22,7 @@ B<rpower> I<noderange> [B<pduon>|B<pduoff>|B<pdustat>|B<pdureset>] | ||||
|  | ||||
| =head2 OpenPOWER OpenBMC: | ||||
|  | ||||
| B<rpower> I<noderange> [B<off>|B<on>|B<reset>|B<boot>|B<stat>|B<state>|B<status>] | ||||
| B<rpower> I<noderange> [B<off>|B<on>|B<softoff>|B<reset>|B<boot>|B<stat>|B<state>|B<status>] | ||||
|  | ||||
| =head2 PPC (with IVM or HMC) specific: | ||||
|  | ||||
|   | ||||
| @@ -168,6 +168,11 @@ my %status_info = ( | ||||
|     RPOWER_OFF_RESPONSE => { | ||||
|         process        => \&rpower_response, | ||||
|     }, | ||||
|     RPOWER_SOFTOFF_REQUEST  => { | ||||
|         method         => "PUT", | ||||
|         init_url       => "$openbmc_project_url/state/host0/attr/RequestedHostTransition", | ||||
|         data           => "xyz.openbmc_project.State.Host.Transition.Off", | ||||
|     }, | ||||
|     RPOWER_RESET_REQUEST  => { | ||||
|         method         => "PUT", | ||||
|         init_url       => "$openbmc_project_url/state/host0/attr/RequestedHostTransition", | ||||
| @@ -441,7 +446,7 @@ sub parse_args { | ||||
|     } | ||||
|  | ||||
|     if ($command eq "rpower") { | ||||
|         unless ($subcommand =~ /^on$|^off$|^reset$|^boot$|^status$|^stat$|^state$/) { | ||||
|         unless ($subcommand =~ /^on$|^off$|^softoff$|^reset$|^boot$|^status$|^stat$|^state$/) { | ||||
|             return ([ 1, "Unsupported command: $command $subcommand" ]); | ||||
|         } | ||||
|     } elsif ($command eq "rinv") { | ||||
| @@ -566,6 +571,9 @@ sub parse_command_status { | ||||
|         } elsif ($subcommand eq "off") { | ||||
|             $next_status{LOGIN_RESPONSE} = "RPOWER_OFF_REQUEST"; | ||||
|             $next_status{RPOWER_OFF_REQUEST} = "RPOWER_OFF_RESPONSE"; | ||||
|         } elsif ($subcommand eq "softoff") { | ||||
|             $next_status{LOGIN_RESPONSE} = "RPOWER_SOFTOFF_REQUEST"; | ||||
|             $next_status{RPOWER_SOFTOFF_REQUEST} = "RPOWER_OFF_RESPONSE"; | ||||
|         } elsif ($subcommand eq "reset") { | ||||
|             $next_status{LOGIN_RESPONSE} = "RPOWER_RESET_REQUEST"; | ||||
|             $next_status{RPOWER_RESET_REQUEST} = "RPOWER_RESET_RESPONSE"; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user