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/test/hypervisor_state.cpp b/test/hypervisor_state.cpp
index a6ee783..9136c83 100644
--- a/test/hypervisor_state.cpp
+++ b/test/hypervisor_state.cpp
@@ -36,4 +36,9 @@
"ProgressStages.OSRunning";
hypObj.updateCurrentHostState(bootProgress);
EXPECT_EQ(hypObj.currentHostState(), server::Host::HostState::Running);
+
+ bootProgress = "xyz.openbmc_project.State.Boot.Progress."
+ "ProgressStages.Unspecified";
+ hypObj.updateCurrentHostState(bootProgress);
+ EXPECT_EQ(hypObj.currentHostState(), server::Host::HostState::Off);
}