summaryrefslogtreecommitdiffstats
path: root/extensions/openpower-pels/manager.cpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-07-18 16:09:49 -0500
committerMatt Spinler <spinler@us.ibm.com>2019-08-05 12:49:54 -0500
commit475e574da95a75af6001fdc2198c1892c1bfc041 (patch)
tree300ad665175938de6b3b7a069b04b2cb3bf57260 /extensions/openpower-pels/manager.cpp
parent89fa082a68c975128db6fa96eab33200c6bc7bb6 (diff)
downloadphosphor-logging-475e574da95a75af6001fdc2198c1892c1bfc041.tar.gz
phosphor-logging-475e574da95a75af6001fdc2198c1892c1bfc041.zip
PEL: Remove a PEL based on an ID
When someone deletes an OpenBMC event log, the corresponding PEL should also be deleted. This commit adds support for that by keeping an internal map of the IDs to the files that contain the PEL data in the repository in order to find the file to remove. This will then get called in the phosphor-logging extension's delete hook. The actual map key is a structure of both the PEL ID and OpenBMC log ID, so either can be used to find a PEL in the repository, which will be useful in other cases, for example for retrieving PEL data based on the PEL ID. As the map needs to match the actual repository file contents, it will get built on startup, and modified when PELs are added and removed. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I33bb96da297c770e175c5c6b19705dda1c8766b6
Diffstat (limited to 'extensions/openpower-pels/manager.cpp')
-rw-r--r--extensions/openpower-pels/manager.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/extensions/openpower-pels/manager.cpp b/extensions/openpower-pels/manager.cpp
index a009188..ef071bd 100644
--- a/extensions/openpower-pels/manager.cpp
+++ b/extensions/openpower-pels/manager.cpp
@@ -94,6 +94,9 @@ void Manager::addRawPEL(const std::string& rawPelPath, uint32_t obmcLogID)
void Manager::erase(uint32_t obmcLogID)
{
+ Repository::LogID id{Repository::LogID::Obmc(obmcLogID)};
+
+ _repo.remove(id);
}
bool Manager::isDeleteProhibited(uint32_t obmcLogID)
OpenPOWER on IntegriCloud