Add SEL delete method and track record IDs
Add SEL delete method which removes the line associated with the target
entry from the SEL files. Upcoming record IDs to be used will now be
stored into a vector to keep track of the next available record ID. The
vector will be backed up to a file in case the phosphor-sel-logger
service restarts. In the case of SEL entry deletion, the record ID with
that associated entry can now be reused and will take priority in being
used when a new SEL entry is added.
If multiple entries are deleted, then the Record IDs will be reused in
a LIFO fashion. Timestamps are updated for "Last Del Time" as specified
by the spec.
The SEL delete method is behind the "sel-delete" build option to
preserve backwards stability since it requires a departure from the
previous way that the next record ID is calculated.
Tested:
* Generated SEL entries.
* Successfully removed a SEL entry using a dbus call:
busctl call xyz.openbmc_project.Logging.IPMI \
/xyz/openbmc_project/Logging/IPMI xyz.openbmc_project.Logging.IPMI \
IpmiSelDelete q <RecordID>
* The next SEL entry added uses the same Record ID associated with the
entry that was previously deleted.
Change-Id: If51f6bf2d7c61b73b5568874488cdd61031dc6ca
Signed-off-by: Jonico Eustaquio <jonico.eustaquio@fii-na.com>
diff --git a/meson.options b/meson.options
index 1c0866c..39f082d 100644
--- a/meson.options
+++ b/meson.options
@@ -10,3 +10,5 @@
description: 'Automatically log SEL records for host error events')
option('send-to-logger', type: 'boolean',
description: 'Automatically log events to Redfish for pulse type assert-deassert sensor events')
+option('sel-delete', type: 'boolean',
+ description: 'Enables ability to delete SEL entries given a record ID')
\ No newline at end of file