OpenPOWER: Allow initiating mp reboot dump in quiesced state
When system dumps are disabled, a system dump collection
request will end up in quiesced state. A memory preserving
reboot from that state can get the failed data from the host.
So enabling the mp reboot dump collection from quiesced state.
Test:
Disable dump
Inject error in host to move to quiesced state
Start mp reboot
Dump should be generated
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
Change-Id: I9f444752b321f1ab47b99e5b8ac32c79182d6453
diff --git a/dump_utils.hpp b/dump_utils.hpp
index 83952a3..82fff10 100644
--- a/dump_utils.hpp
+++ b/dump_utils.hpp
@@ -12,6 +12,7 @@
#include <xyz/openbmc_project/Common/error.hpp>
#include <xyz/openbmc_project/Dump/Create/server.hpp>
#include <xyz/openbmc_project/State/Boot/Progress/server.hpp>
+#include <xyz/openbmc_project/State/Host/server.hpp>
#include <memory>
@@ -22,6 +23,8 @@
using BootProgress = sdbusplus::xyz::openbmc_project::State::Boot::server::
Progress::ProgressStages;
+using HostState =
+ sdbusplus::xyz::openbmc_project::State::server::Host::HostState;
using namespace phosphor::logging;
using namespace sdbusplus::xyz::openbmc_project::Common::Error;
@@ -86,6 +89,15 @@
const std::string& interface);
/**
+ * @brief Get the host state
+ *
+ * @return HostState on success
+ * Throw exception on failure
+ *
+ */
+HostState getHostState();
+
+/**
* @brief Get the host boot progress stage
*
* @return BootProgress on success
@@ -95,6 +107,19 @@
BootProgress getBootProgress();
/**
+ * @brief Get the host state value
+ *
+ * @param[in] intf - Interface to get the value
+ * @param[in] objPath - Object path of the service
+ * @param[in] state - State name to get
+ *
+ * @return The state value on success
+ * Throw exception on failure
+ */
+std::string getStateValue(const std::string& intf, const std::string& objPath,
+ const std::string& state);
+
+/**
* @brief Check whether host is running
*
* @return true if the host running else false.
@@ -169,5 +194,13 @@
}
}
+/**
+ * @brief Check whether host is quiesced
+ *
+ * @return true if the host is quiesced else false.
+ * Throw exception on failure.
+ */
+bool isHostQuiesced();
+
} // namespace dump
} // namespace phosphor