PEL: Prevent deletion if it's associated with HWIsolation
- This ensures that PELs linked to HWIsolation records are protected
from accidental deletion.
- Shows error message of "Call failed: The service is temporarily
unavailable.", when attempting to delete such a PEL individually.
- If trying to Delete all, will skip such PELs without showing any
message.
Tested:
Sample output:
```bash
$ busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/
logging xyz.openbmc_project.Collection.DeleteAll DeleteAll
$ busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/
logging/entry/2 xyz.openbmc_project.Object.Delete Delete
Call failed: The service is temporarily unavailable.
```
Change-Id: I2d28de91bbb0fbc2a991e3d5e5631814d41fe044
Signed-off-by: Harsh Agarwal <Harsh.Agarwal@ibm.com>
diff --git a/log_manager.hpp b/log_manager.hpp
index cc42d8a..436f572 100644
--- a/log_manager.hpp
+++ b/log_manager.hpp
@@ -116,20 +116,7 @@
*
* @return size_t - count of erased entries
*/
- size_t eraseAll()
- {
- size_t entriesSize = entries.size();
- auto iter = entries.begin();
- while (iter != entries.end())
- {
- auto e = iter->first;
- ++iter;
- erase(e);
- }
- entryId = 0;
-
- return entriesSize;
- }
+ size_t eraseAll();
/** @brief Returns the count of high severity errors
*