Add OCC present count detection and watch
Add a Presence child class of Error to handle detecting the number of
OCCs available. Add an instance of this Presence class if the Device
detects that it is the master OCC, since the number of present OCCs is
only reported by the master OCC. When a change to the number of OCCs
reported is detected, compare with the number of OCCs determined to be
active by the Manager, and if there is a mismatch, follow the usual
error path (reset OCC, etc).
Partially resolves openbmc/openbmc#2285
See https://gerrit.openbmc-project.xyz/#/c/7843/
Change-Id: Idbaca52b307992d9b01fe15439ab746ef6d64397
Signed-off-by: Edward A. James <eajames@us.ibm.com>
diff --git a/occ_status.hpp b/occ_status.hpp
index a334a2b..55ee539 100644
--- a/occ_status.hpp
+++ b/occ_status.hpp
@@ -14,6 +14,7 @@
namespace occ
{
+class Manager;
namespace Base = sdbusplus::org::open_power::OCC::server;
using Interface = sdbusplus::server::object::object<Base::Status>;
@@ -48,12 +49,14 @@
* @param[in] bus - DBus bus to attach to
* @param[in] event - sd_event unique pointer reference
* @param[in] path - DBus object path
+ * @param[in] manager - OCC manager instance
* @param[in] callBack - Callback handler to invoke during
* property change
*/
Status(sdbusplus::bus::bus& bus,
EventPtr& event,
const char* path,
+ const Manager& manager,
std::function<void(bool)> callBack = nullptr)
: Interface(bus, path, true),
bus(bus),
@@ -66,6 +69,7 @@
#else
name + std::to_string(instance + 1),
#endif
+ manager,
std::bind(&Status::deviceErrorHandler, this)),
hostControlSignal(
bus,