PSM: host-state: prevent incorrect dbus events on initialization
The DC log is generated by phosphor-sel-logger to listen
for changes in the Host CurrentHostState.
A dbus event should not be generated when
initializing the properties within the host state manager.
The dbus events should only be generated on
actual state changes to prevent invalid state change logs.
Change-Id: I1ea3067889844751deead2113b5d1b69a20ce811
Signed-off-by: Peter Yin <peter.yin@quantatw.com>
diff --git a/host_state_manager.cpp b/host_state_manager.cpp
index 160872d..365ed84 100644
--- a/host_state_manager.cpp
+++ b/host_state_manager.cpp
@@ -67,20 +67,20 @@
isHostRunning(id))
{
info("Initial Host State will be Running");
- server::Host::currentHostState(HostState::Running);
- server::Host::requestedHostTransition(Transition::On);
+ server::Host::currentHostState(HostState::Running, true);
+ server::Host::requestedHostTransition(Transition::On, true);
}
else
{
info("Initial Host State will be Off");
- server::Host::currentHostState(HostState::Off);
- server::Host::requestedHostTransition(Transition::Off);
+ server::Host::currentHostState(HostState::Off, true);
+ server::Host::requestedHostTransition(Transition::Off, true);
}
if (!deserialize())
{
// set to default value.
- server::Host::requestedHostTransition(Transition::Off);
+ server::Host::requestedHostTransition(Transition::Off, true);
}
return;
}