boot-block: remove blocking error on erase
When an entry is erased, remove it from the blocking array. This will
result in the d-bus object at the /xyz/openbmc_project/logging/blockX
path being deleted as well.
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: Ib49073532588d25c4ae357917ecd6339a70d8c1e
diff --git a/log_manager.cpp b/log_manager.cpp
index 72a8f3c..929ff5d 100644
--- a/log_manager.cpp
+++ b/log_manager.cpp
@@ -352,6 +352,18 @@
}
}
+void Manager::checkAndRemoveBlockingError(uint32_t entryId)
+{
+ auto it = find_if(
+ blockingErrors.begin(), blockingErrors.end(),
+ [&](std::unique_ptr<Block>& obj) { return obj->entryId == entryId; });
+ if (it != blockingErrors.end())
+ {
+ blockingErrors.erase(it);
+ }
+ return;
+}
+
void Manager::erase(uint32_t entryId)
{
auto entryFound = entries.find(entryId);
@@ -400,6 +412,8 @@
}
entries.erase(entryFound);
+ checkAndRemoveBlockingError(entryId);
+
for (auto& remove : Extensions::getDeleteFunctions())
{
try