autoreboot: one-time object support
The new one_time D-Bus object is utilized for setting RebootPolicy for a
single boot. phosphor-state-manager will always look at this object
first for reboot policy, if it is the default of true, then
phosphor-state-manager will then look at the persistent user setting
under the non one_time object path.
See the following commit for more info:
https://github.com/openbmc/meta-phosphor/commit/7d29e7a2c135e91b222c57c66bb7ca61aae6398e
Tested:
Via some debug statements, confirmed that Path variables are both
updated with correct settings object.
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I8ef882633237529e03070607542b9acc218dffc6
diff --git a/settings.cpp b/settings.cpp
index 7a7784b..cc0b4cb 100644
--- a/settings.cpp
+++ b/settings.cpp
@@ -60,7 +60,20 @@
{
if (autoRebootIntf == interface)
{
- autoReboot = path;
+ /* There are two implementations of the AutoReboot
+ * Interface. A persistent user setting and a one-time
+ * setting which is only valid for one boot of the system.
+ * The one-time setting will have "one_time" in its
+ * object path.
+ */
+ if (path.find("one_time") != std::string::npos)
+ {
+ autoRebootOneTime = path;
+ }
+ else
+ {
+ autoReboot = path;
+ }
}
else if (powerRestoreIntf == interface)
{
diff --git a/settings.hpp b/settings.hpp
index dca5cf9..de8be65 100644
--- a/settings.hpp
+++ b/settings.hpp
@@ -44,9 +44,12 @@
*/
Service service(const Path& path, const Interface& interface) const;
- /** @brief host auto_reboot settings object */
+ /** @brief host auto_reboot user settings object */
Path autoReboot;
+ /** @brief host auto_reboot one-time settings object */
+ Path autoRebootOneTime;
+
/** @brief host power_restore_policy settings object */
Path powerRestorePolicy;