hypervisor: reset requested host state on power off
The hypervisor only supports a one-shot Standby->Running transition
request. To make things more user friendly, reset the requested
transition on server power off's since there's no reason to keep around
the previous requests.
Tested:
- Built image with all related changes and verified hypervisor state
correctly tracked with BootProgress and that requesting an On
transition successfully made it to the hypervisor.
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I0f06dde6f6f0c203ed69c238acdb95fcfd8a1d15
diff --git a/hypervisor_state_manager.cpp b/hypervisor_state_manager.cpp
index afd496a..e1f5106 100644
--- a/hypervisor_state_manager.cpp
+++ b/hypervisor_state_manager.cpp
@@ -79,6 +79,15 @@
{
currentHostState(server::Host::HostState::Running);
}
+ else if (bootProgress == "xyz.openbmc_project.State.Boot.Progress."
+ "ProgressStages.Unspecified")
+ {
+ // Unspecified is set when the system is powered off so
+ // set the state to off and reset the requested host state
+ // back to its default
+ currentHostState(server::Host::HostState::Off);
+ server::Host::requestedHostTransition(server::Host::Transition::Off);
+ }
else
{
// BootProgress changed and it is not one of the above so