Disable host watchdog during dump collection
Host watchdog to be disabled during hostboot and hardware dump
collection.
During a checkstop attention, the system is not functioning normally. So
a hardware or hostboot dump is collected and it could take a while to
get completed. If the watchdog timer is active during that time, it may
get triggered. As we already know the system is not functioning
normally and are collecting dump, disable the watchdog when the dump
collection is in progress.
Tested and ensured that one dump is created during a checkstop.
From the logs was able to identify that the host watchdog is disabled
just when the dump collection starts and host watchdog resumes after the
dump collection.
It is verified for both hardware dump and hostboot dump
Change-Id: I5f9df253594f9e858ca0477acb3ce1f3a4639785
Signed-off-by: deepakala-k <deepakala.karthikeyan@ibm.com>
diff --git a/util/dbus.hpp b/util/dbus.hpp
index 32d1b9c..c1dc252 100644
--- a/util/dbus.hpp
+++ b/util/dbus.hpp
@@ -2,6 +2,7 @@
#include <sdbusplus/bus.hpp>
#include <util/ffdc_file.hpp>
+#include <util/trace.hpp>
#include <string>
#include <variant>
@@ -56,6 +57,31 @@
const std::string& i_service, const std::string& i_property,
DBusValue& o_response);
+template <typename T>
+void setProperty(const std::string& service, const std::string& object,
+ const std::string& interface, const std::string& propertyName,
+ const std::variant<T>& propertyValue)
+{
+ try
+ {
+ auto bus = sdbusplus::bus::new_default();
+ auto method = bus.new_method_call(service.c_str(), object.c_str(),
+ "org.freedesktop.DBus.Properties",
+ "Set");
+ method.append(interface);
+ method.append(propertyName);
+ method.append(propertyValue);
+
+ bus.call(method);
+ }
+ catch (const sdbusplus::exception::SdBusError& e)
+ {
+ trace::err("util::dbus::setProperty exception");
+ std::string traceMsg = std::string(e.what());
+ trace::err(traceMsg.c_str());
+ }
+}
+
/**
* Get the IBM compatible names defined for this system
*