pldmd: Migrate instance ID allocation to pldm::InstanceIdDb
This removes use of `pldm::dbus_api::Requester` from around the
code-base. This makes progress towards removing the DBus API entirely
once all its consumers are converted to the libpldm instance ID APIs.
There was never a good reason for the code using the class to have
knowledge that it was related to DBus anyway, so this is, in-effect, a
double clean up improving separation of concerns.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I2d9397cae1b3c8c251c32e36ca520aad9c9b8cf6
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
index fd1b0c4..c4befbb 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
@@ -368,7 +368,7 @@
eventClass->sensor_offset = sensorOffset;
eventClass->event_state = eventState;
eventClass->previous_event_state = prevEventState;
- auto instanceId = requester.getInstanceId(mctp_eid);
+ auto instanceId = instanceIdDb.next(mctp_eid);
std::vector<uint8_t> requestMsg(sizeof(pldm_msg_hdr) +
PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES +
sensorEventDataVec.size());
@@ -377,7 +377,7 @@
if (rc != PLDM_SUCCESS)
{
error("Failed to encode state sensor event, rc = {RC}", "RC", rc);
- requester.markFree(mctp_eid, instanceId);
+ instanceIdDb.free(mctp_eid, instanceId);
return;
}
rc = sendEventToHost(requestMsg, instanceId);