chassis-state-manager: Add multi-chassis support
Add multi-chassis management support, each chassis bus separates by
giving a unique chassis id.
Current code only support single chassis, and alway assume bus name is
"xyz.openbmc_project.State.Chassis".
This patch allow user to launch chassis-state-manager with a chassis id,
and chassis id is added into service bus name for identification.
Because there are many places hardcode with bus name
"xyz.openbmc_project.State.Chassis", if chassis id is 0,
chassis-state-manager will request both
"xyz.openbmc_project.State.Chassis" and
"xyz.openbmc_project.State.Chassis0" bus name to meet backwards
compatibility.
Tested on Bletchley:
root@bletchley:~# busctl tree xyz.openbmc_project.State.Chassis
`-/xyz
`-/xyz/openbmc_project
`-/xyz/openbmc_project/state
`-/xyz/openbmc_project/state/chassis0
root@bletchley:~# busctl tree xyz.openbmc_project.State.Chassis0
`-/xyz
`-/xyz/openbmc_project
`-/xyz/openbmc_project/state
`-/xyz/openbmc_project/state/chassis0
root@bletchley:~# busctl tree xyz.openbmc_project.State.Chassis1
`-/xyz
`-/xyz/openbmc_project
`-/xyz/openbmc_project/state
`-/xyz/openbmc_project/state/chassis1
......
patch dependencies:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-state-manager/+/51465
Signed-off-by: Potin Lai <potin.lai@quantatw.com>
Change-Id: I2ce3e9ab2c95a2688143f4e3775da164a5c33c19
diff --git a/host_check.hpp b/host_check.hpp
index 1a64912..9ef7302 100644
--- a/host_check.hpp
+++ b/host_check.hpp
@@ -1,5 +1,7 @@
#pragma once
+#include <cstddef>
+
namespace phosphor
{
namespace state
@@ -11,7 +13,7 @@
*
* @return True if host running, False otherwise
*/
-bool isHostRunning();
+bool isHostRunning(size_t hostId = 0);
} // namespace manager
} // namespace state