diff options
author | Andrew Geissler <andrewg@us.ibm.com> | 2017-05-24 15:18:01 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-06-06 20:01:58 +0000 |
commit | 4f309e8c68907218bc808af94475c1b056d0ae6e (patch) | |
tree | 6db5171f19d6674c5687823b687697c7cbcaaa19 | |
parent | 48696ce1a4a5b894382f0c9336a93d43f23b5fb1 (diff) | |
download | phosphor-state-manager-4f309e8c68907218bc808af94475c1b056d0ae6e.tar.gz phosphor-state-manager-4f309e8c68907218bc808af94475c1b056d0ae6e.zip |
Enable soft power off
The shutdown target provides the soft power off
function and also handles situations where the
service should be skipped
Resolves openbmc/openbmc#1286
Resolves openbmc/openbmc#1670
Change-Id: I2c1705f09f7840107ae0cc15ede02eafd50fcbbd
Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
-rw-r--r-- | host_state_manager.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/host_state_manager.cpp b/host_state_manager.cpp index f33c8ad..fd1d056 100644 --- a/host_state_manager.cpp +++ b/host_state_manager.cpp @@ -18,6 +18,10 @@ namespace server = sdbusplus::xyz::openbmc_project::State::server; using namespace phosphor::logging; +// host-shutdown notifies host of shutdown and that leads to host-stop being +// called so initiate a host shutdown with the -shutdown target and consider the +// host shut down when the -stop target is complete +constexpr auto HOST_STATE_SOFT_POWEROFF_TGT = "obmc-host-shutdown@0.target"; constexpr auto HOST_STATE_POWEROFF_TGT = "obmc-host-stop@0.target"; constexpr auto HOST_STATE_POWERON_TGT = "obmc-host-start@0.target"; constexpr auto HOST_STATE_QUIESCE_TGT = "obmc-host-quiesce@0.target"; @@ -28,7 +32,7 @@ constexpr auto ACTIVATING_STATE = "activating"; /* Map a transition to it's systemd target */ const std::map<server::Host::Transition,std::string> SYSTEMD_TARGET_TABLE = { - {server::Host::Transition::Off, HOST_STATE_POWEROFF_TGT}, + {server::Host::Transition::Off, HOST_STATE_SOFT_POWEROFF_TGT}, {server::Host::Transition::On, HOST_STATE_POWERON_TGT} }; |