Watchdog: Add watchdog LogTimeout property setting function
Add function to set LogTimeout property to implement the function of
the watchdog not recording logs.
Tested:
No log bit is set to true :
ipmitool raw 0x06 0x24 0x84 0x00 0x00 0x3e 0x64 0x00
No log bit is set to false :
ipmitool raw 0x06 0x24 0x04 0x00 0x00 0x3e 0x64 0x00
Reset watchdog timer :
ipmitool mc watchdog reset
If the LogTimeout property is true, the event will be logged
on watchdog expiration.
We can use 'ipmitool sel elist' to check the system event log.
1 | 01/26/23 | 00:21:21 PST | Watchdog2 host0 | Timer expired | Asserted
If the LogTimeout property is false, the event will not be
logged when the watchdog expires.
Related-Commit-Id: 66240
Related-Commit-Id: 67727
Change-Id: I9cf9a294be7f584760dc03efaab02384f17e4686
Signed-off-by: Tim Chao <Tim.Chao@quantatw.com>
diff --git a/app/watchdog.cpp b/app/watchdog.cpp
index cf26e56..e64cb72 100644
--- a/app/watchdog.cpp
+++ b/app/watchdog.cpp
@@ -249,6 +249,7 @@
// Mark as initialized so that future resets behave correctly
wd_service.setInitialized(true);
+ wd_service.setLogTimeout(!dontLog);
lastCallSuccessful = true;
return ipmi::responseSuccess();
diff --git a/app/watchdog_service.cpp b/app/watchdog_service.cpp
index 22227cc..7ba0932 100644
--- a/app/watchdog_service.cpp
+++ b/app/watchdog_service.cpp
@@ -183,6 +183,11 @@
setProperty("Enabled", enabled);
}
+void WatchdogService::setLogTimeout(bool LogTimeout)
+{
+ setProperty("LogTimeout", LogTimeout);
+}
+
void WatchdogService::setExpireAction(Action expireAction)
{
setProperty("ExpireAction", convertForMessage(expireAction));
diff --git a/app/watchdog_service.hpp b/app/watchdog_service.hpp
index 7350824..5717066 100644
--- a/app/watchdog_service.hpp
+++ b/app/watchdog_service.hpp
@@ -67,6 +67,12 @@
*/
void setEnabled(bool enabled);
+ /** @brief Sets the value of the LogTimeout property on the host watchdog
+ *
+ * @param[in] LogTimeout - The new LogTimeout value
+ */
+ void setLogTimeout(bool LogTimeout);
+
/** @brief Sets the value of the expireAction property on the host watchdog
*
* @param[in] expireAction - The new expireAction value