diff options
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) { |