Add Group Event Support for PSU
Some group events such as PSU Fan Fault will only have one event but
have more than one target to trigger redfish log. For example, PSU Fan
only has one event PSU Fan Fault, any Fan failure will trigger PSU Fan
Fault and change the functional property to false. But if another PSU
Fan failure happens, we still need to trigger a redfish log to indicate
the specific fan number. So change the PSU Event logic to support this
feature.
Tested:
Remove one of the PSU, Redfish Log show PSU Fan Fault on Fan1 and Fan2.
Insert the PSU and Redfish Log show PSU Fan1 and Fan2 recovered.
Signed-off-by: Cheng C Yang <cheng.c.yang@linux.intel.com>
Change-Id: I1a21d5a2a8172183b05b37a5ef747bd4f3510368
diff --git a/include/PSUEvent.hpp b/include/PSUEvent.hpp
index 89840a3..71fd5d0 100644
--- a/include/PSUEvent.hpp
+++ b/include/PSUEvent.hpp
@@ -28,7 +28,7 @@
public:
PSUSubEvent(std::shared_ptr<sdbusplus::asio::dbus_interface> eventInterface,
const std::string& path, boost::asio::io_service& io,
- const std::string& eventName,
+ const std::string& groupEventName, const std::string& eventName,
std::shared_ptr<std::set<std::string>> asserts,
std::shared_ptr<std::set<std::string>> combineEvent,
std::shared_ptr<bool> state, const std::string& psuName);
@@ -44,6 +44,7 @@
size_t errCount;
std::string path;
std::string eventName;
+ std::string groupEventName;
boost::asio::deadline_timer waitTimer;
boost::asio::streambuf readBuf;
void setupRead(void);
@@ -66,6 +67,10 @@
boost::asio::io_service& io, const std::string& psuName,
boost::container::flat_map<std::string, std::vector<std::string>>&
eventPathList,
+ boost::container::flat_map<
+ std::string,
+ boost::container::flat_map<std::string, std::vector<std::string>>>&
+ groupEventPathList,
const std::string& combineEventName);
~PSUCombineEvent();