openpower-pels: Create guard using libguard
Replace CreateWithEntityPath D-Bus method with guard library calls for
creating guard entries, as CreateWithEntityPath is not an approved dbus
method.
Tested and the guard record is created with the corresponding PEL id
```
before injecting the error
root@p10bmc:~# guard -l
No unresolved records to display
After injecting error, the guard is created using the PEL ID
root@p10bmc:~# guard -l
ID | ERROR | Type | Path
0x00000001 | 0x5000592b | unrecoverable | physical:sys-0/node-0/proc-0/eq-1/fc-0/core-0
root@p10bmc:~# peltool -l
{
"0x5000592B": {
"SRC": "BD13E510",
"Message": "Error Signature: 0x20DA0020 0x00000001 0x4D740407",
"PLID": "0x5000592B",
"CreatorID": "BMC",
"Subsystem": "Processor Unit (CPU)",
"Commit Time": "10/17/2024 09:54:22",
"Sev": "Unrecoverable Error",
"CompID": "bmc hw diags"
}
}
```
Change-Id: I7531bce403206beaa119aea0a621e6b47d28ffd0
Signed-off-by: deepakala-k <deepakala.karthikeyan@ibm.com>
diff --git a/extensions/openpower-pels/pel.cpp b/extensions/openpower-pels/pel.cpp
index 8b635e5..9f09a01 100644
--- a/extensions/openpower-pels/pel.cpp
+++ b/extensions/openpower-pels/pel.cpp
@@ -34,6 +34,11 @@
#ifdef PEL_ENABLE_PHAL
#include "phal_service_actions.hpp"
#include "sbe_ffdc_handler.hpp"
+
+#include <libguard/guard_interface.hpp>
+#include <libguard/include/guard_record.hpp>
+
+namespace libguard = openpower::guard;
#endif
#include <sys/stat.h>
@@ -175,8 +180,7 @@
#ifdef PEL_ENABLE_PHAL
auto path = std::string(OBJ_ENTRY) + '/' + std::to_string(obmcLogID);
- openpower::pels::phal::createServiceActions(callouts, path, dataIface,
- plid());
+ openpower::pels::phal::createServiceActions(callouts, dataIface, plid());
#endif
// Store in the PEL any important debug data created while