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/fw-update/device_updater.cpp b/fw-update/device_updater.cpp
index 4009a48..20bca0c 100644
--- a/fw-update/device_updater.cpp
+++ b/fw-update/device_updater.cpp
@@ -19,7 +19,7 @@
void DeviceUpdater::startFwUpdateFlow()
{
- auto instanceId = updateManager->requester.getInstanceId(eid);
+ auto instanceId = updateManager->instanceIdDb.next(eid);
// NumberOfComponents
const auto& applicableComponents =
std::get<ApplicableComponents>(fwDeviceIDRecord);
@@ -48,7 +48,7 @@
sizeof(struct pldm_request_update_req) + compImgSetVerStrInfo.length);
if (rc)
{
- updateManager->requester.markFree(eid, instanceId);
+ updateManager->instanceIdDb.free(eid, instanceId);
error("encode_request_update_req failed, EID = {EID}, RC = {RC}", "EID",
unsigned(eid), "RC", rc);
// Handle error scenario
@@ -107,7 +107,7 @@
{
pldmRequest.reset();
- auto instanceId = updateManager->requester.getInstanceId(eid);
+ auto instanceId = updateManager->instanceIdDb.next(eid);
// TransferFlag
const auto& applicableComponents =
std::get<ApplicableComponents>(fwDeviceIDRecord);
@@ -170,7 +170,7 @@
sizeof(pldm_pass_component_table_req) + compVerStrInfo.length);
if (rc)
{
- updateManager->requester.markFree(eid, instanceId);
+ updateManager->instanceIdDb.free(eid, instanceId);
error("encode_pass_component_table_req failed, EID = {EID}, RC = {RC}",
"EID", unsigned(eid), "RC", rc);
// Handle error scenario
@@ -249,7 +249,7 @@
{
pldmRequest.reset();
- auto instanceId = updateManager->requester.getInstanceId(eid);
+ auto instanceId = updateManager->instanceIdDb.next(eid);
const auto& applicableComponents =
std::get<ApplicableComponents>(fwDeviceIDRecord);
const auto& comp = compImageInfos[applicableComponents[offset]];
@@ -297,7 +297,7 @@
sizeof(pldm_update_component_req) + compVerStrInfo.length);
if (rc)
{
- updateManager->requester.markFree(eid, instanceId);
+ updateManager->instanceIdDb.free(eid, instanceId);
error("encode_update_component_req failed, EID={EID}, RC = {RC}", "EID",
unsigned(eid), "RC", rc);
// Handle error scenario
@@ -631,7 +631,7 @@
void DeviceUpdater::sendActivateFirmwareRequest()
{
pldmRequest.reset();
- auto instanceId = updateManager->requester.getInstanceId(eid);
+ auto instanceId = updateManager->instanceIdDb.next(eid);
Request request(sizeof(pldm_msg_hdr) +
sizeof(struct pldm_activate_firmware_req));
auto requestMsg = reinterpret_cast<pldm_msg*>(request.data());
@@ -641,7 +641,7 @@
sizeof(pldm_activate_firmware_req));
if (rc)
{
- updateManager->requester.markFree(eid, instanceId);
+ updateManager->instanceIdDb.free(eid, instanceId);
error("encode_activate_firmware_req failed, EID={EID}, RC = {RC}",
"EID", unsigned(eid), "RC", rc);
}