sched-host-tran: store/restore the value of scheduled time and
requested transition
Store/restore the value of scheduled time and requested transition, in case
BMC is rebooted. After BMC is back, go on the host transition process based
on the stored values.
Tested:
1. Get current time
# date
Tue Mar 10 08:16:40 UTC 2020
2. Set scheduled time 08:25:00
# busctl set-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime t 1583828700
3. Reboot BMC
4. Check sheduled time
# busctl get-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime
t 1583828700
5. Do host transition after the scheduled time is reached.
6. Check the scheduled time again
# busctl get-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime
t 0
Change-Id: I3bbae19a49e2fe84bf4e297e6daaa0461cbf2cb8
Signed-off-by: Carol Wang <wangkair@cn.ibm.com>
diff --git a/meson_options.txt b/meson_options.txt
index 443e85c..385323d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -61,6 +61,12 @@
)
option(
+ 'scheduled-host-transition-persist-path', type: 'string',
+ value: '/var/lib/phosphor-state-manager/scheduledHostTransition',
+ description: 'Path of file for storing the scheduled time and the requested transition.',
+)
+
+option(
'boot-count-max-allowed', type: 'integer',
value: 3,
description: 'The maximum allowed reboot count.',