diff options
author | Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com> | 2017-02-24 00:16:05 +0530 |
---|---|---|
committer | Andrew Geissler <geissonator@yahoo.com> | 2017-03-29 13:29:18 +0000 |
commit | 917454bb139be75f656ddfa451e5036fc24ce640 (patch) | |
tree | e8e55b7539804d070257e8425df777a29e994783 /softoff/softoff.cpp | |
parent | 0661beb1dd93711ce684450997d21da8b64c729d (diff) | |
download | phosphor-host-ipmid-917454bb139be75f656ddfa451e5036fc24ce640.tar.gz phosphor-host-ipmid-917454bb139be75f656ddfa451e5036fc24ce640.zip |
Generate errorlog when timer expires waiting for host to shutdown
Fixes openbmc/openbmc#930
Change-Id: I1780071d5cbef23df88c17fe131098f54f54f25f
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
Diffstat (limited to 'softoff/softoff.cpp')
-rw-r--r-- | softoff/softoff.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/softoff/softoff.cpp b/softoff/softoff.cpp index e88096f..88aa6cf 100644 --- a/softoff/softoff.cpp +++ b/softoff/softoff.cpp @@ -22,7 +22,7 @@ namespace phosphor namespace ipmi { -/** @brief Send the SMS_ATN to host if value is set */ +// Sends the SMS_ATN to host if value is set void SoftPowerOff::sendSMSAttn() { using namespace std::chrono; @@ -46,7 +46,13 @@ void SoftPowerOff::sendSMSAttn() return; } -/** @brief Host Response handler */ +// Starts a timer +int SoftPowerOff::startTimer(const std::chrono::microseconds& usec) +{ + return timer.startTimer(usec); +} + +// Host Response handler auto SoftPowerOff::responseReceived(HostResponse response) -> HostResponse { using namespace std::chrono; @@ -57,12 +63,19 @@ auto SoftPowerOff::responseReceived(HostResponse response) -> HostResponse // Need to stop the running timer and then start a new timer auto time = duration_cast<microseconds>( seconds(IPMI_HOST_SHUTDOWN_COMPLETE_TIMEOUT_SECS)); - auto r = timer.startTimer(time); + auto r = startTimer(time); if (r < 0) { - log<level::ERR>("Failure to start HostQuiesce wait timer", + log<level::ERR>("Failure to start Host shutdown wait timer", entry("ERROR=%s", strerror(-r))); } + else + { + log<level::INFO>("Timer started waiting for host to shutdown", + entry("TIMEOUT_IN_MSEC=%llu", + duration_cast<milliseconds>(seconds + (IPMI_HOST_SHUTDOWN_COMPLETE_TIMEOUT_SECS)))); + } } else if (response == HostResponse::HostShutdown) { |