pdr: Get PDR record handles from RepoChangeEvent
Added support to fetch pdr record handles from the repository change
request(pldmPDRRepositoryChgEvent).
The change data record in repository change event supports 3
event data operations ADDED, REMOVED, MODIFIED. For the event data
format "FormatPDRHandles" fetching the pdr handles from the request
for all the event data operations.
Change-Id: I82bcf7ae8455eb5974646eecb4cf4a5e5e503669
Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
diff --git a/libpldmresponder/platform.cpp b/libpldmresponder/platform.cpp
index db6c7b7..7a3b63c 100644
--- a/libpldmresponder/platform.cpp
+++ b/libpldmresponder/platform.cpp
@@ -565,25 +565,21 @@
return rc;
}
- if (eventDataOperation == PLDM_RECORDS_ADDED ||
- eventDataOperation == PLDM_RECORDS_MODIFIED)
+ if (eventDataOperation == PLDM_RECORDS_MODIFIED)
{
- if (eventDataOperation == PLDM_RECORDS_MODIFIED)
- {
- hostPDRHandler->isHostPdrModified = true;
- }
+ hostPDRHandler->isHostPdrModified = true;
+ }
- rc = getPDRRecordHandles(
- reinterpret_cast<const ChangeEntry*>(
- changeRecordData + dataOffset),
- changeRecordDataSize - dataOffset,
- static_cast<size_t>(numberOfChangeEntries),
- pdrRecordHandles);
+ rc = getPDRRecordHandles(
+ reinterpret_cast<const ChangeEntry*>(
+ changeRecordData + dataOffset),
+ changeRecordDataSize - dataOffset,
+ static_cast<size_t>(numberOfChangeEntries), pdrRecordHandles);
- if (rc != PLDM_SUCCESS)
- {
- return rc;
- }
+ if (rc != PLDM_SUCCESS)
+ {
+ error("Invalid data, no pdr handles found");
+ return rc;
}
changeRecordData +=