PEL: Add hidden and subsystem properties
This story adds a new PELEntry interface
org.open_power.Logging.PEL.Entry on existing PEL entry. Then we add 2
properties with their values initialized during the creation of the Interface.
Tested:
1. Verified that the new PEL creation with recoverable error sets the new
attribute in the PEL.entry Interface.
2. Restarted the phosphor-log-manager daemon and made sure the flag is set
with the new Interface created for d-bus
3. Tested with passing a RAWPEL to create from file system and verified
that the hidden attribute is set accordingly on the PEL.entry Interface.
4. Copied the new format error to a system with old code and restored
the error log to make sure it does not crash.
5. Validated both hidden and subsystem properties.
Signed-off-by: Vijay Lobo <vijaylobo@gmail.com>
Change-Id: Ida287ed84a4a3f9ddd054cde37d752219ffb1882
diff --git a/extensions/openpower-pels/manager.hpp b/extensions/openpower-pels/manager.hpp
index aa4a393..5923f00 100644
--- a/extensions/openpower-pels/manager.hpp
+++ b/extensions/openpower-pels/manager.hpp
@@ -11,6 +11,7 @@
#include "registry.hpp"
#include "repository.hpp"
+#include <org/open_power/Logging/PEL/Entry/server.hpp>
#include <org/open_power/Logging/PEL/server.hpp>
#include <sdbusplus/server.hpp>
#include <sdeventplus/event.hpp>
@@ -25,6 +26,9 @@
using PELInterface = sdbusplus::server::object::object<
sdbusplus::org::open_power::Logging::server::PEL>;
+using PELEntry = sdbusplus::org::open_power::Logging::PEL::server::Entry;
+using PropertiesVariant = PELEntry::PropertiesVariant;
+
/**
* @brief PEL manager object
*/
@@ -59,6 +63,8 @@
{
setEntryPath(entry.first);
setServiceProviderNotifyFlag(entry.first);
+ // Create PELEntry interface and setup properties with their values
+ createPELEntry(entry.first);
}
setupPELDeleteWatch();
}
@@ -403,6 +409,16 @@
void updateResolution(std::unique_ptr<openpower::pels::PEL>& pel);
/**
+ * @brief Create PELEntry Interface with supported properties
+ *
+ * Create PELEntry Interface and update all the properties which are
+ * supported
+ *
+ * @param[in] obmcLogID - The OpenBMC entry log ID
+ */
+ void createPELEntry(uint32_t obmcLogID);
+
+ /**
* @brief Reference to phosphor-logging's Manager class
*/
phosphor::logging::internal::Manager& _logManager;
@@ -434,6 +450,15 @@
std::unique_ptr<DataInterfaceBase> _dataIface;
/**
+ * @brief The map used to keep track of PEL entry pointer associated with
+ * event log.
+ */
+ std::map<std::string,
+ std::unique_ptr<
+ sdbusplus::org::open_power::Logging::PEL::server::Entry>>
+ _pelEntries;
+
+ /**
* @brief The HostNotifier object used for telling the
* host about new PELs
*/