summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Geissler <andrewg@us.ibm.com>2017-05-15 15:27:33 -0500
committerPatrick Williams <patrick@stwcx.xyz>2017-05-23 10:59:41 +0000
commitc99ad19b76f233f2c31a02d133770377572fc92a (patch)
tree1852e27231dcf8d0895cbd3d1957ec547dda4bf8
parent222014e0f3e06d6850d78d2f6972ac07e14a0b8c (diff)
downloadphosphor-state-manager-c99ad19b76f233f2c31a02d133770377572fc92a.tar.gz
phosphor-state-manager-c99ad19b76f233f2c31a02d133770377572fc92a.zip
Use shutdown target to stop the host
The shutdown target will use the soft power off application which allows the host to properly shut itself down before power is removed from the chassis Resolves openbmc/openbmc#1286 Change-Id: I7be630237571847a9fa6c37b0b9a8fddf568e47b Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
-rw-r--r--host_state_manager.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/host_state_manager.cpp b/host_state_manager.cpp
index 6731432..57ea219 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 path calls host-stop
+// 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}
};
OpenPOWER on IntegriCloud