oem-ibm: Support for concurrent out-of-band FW update

Redfish triggers the out-of-band code update to BMC. This code update is
called concurrent FW update when the remote PLDM terminus is up during
code update.

The system has two boot sides: Temporary and Permanent, with the default
image running from the temporary side. During an out-of-band (OOB) code
update triggered by the Redfish client, the boot side is swapped, the
correct image is assigned to the permanent side, and a new image is
written to the temporary side. Boot side rename event is used to notify
the remote PLDM terminus about the rename operation during the update.

Change-Id: I21f2b871c5cdd35660e2fc84019749f0365f1d76
Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
diff --git a/oem/ibm/libpldmresponder/inband_code_update.cpp b/oem/ibm/libpldmresponder/inband_code_update.cpp
index d3ea1a8..8acfe56 100644
--- a/oem/ibm/libpldmresponder/inband_code_update.cpp
+++ b/oem/ibm/libpldmresponder/inband_code_update.cpp
@@ -228,10 +228,7 @@
                     {
                         auto propVal = dBusIntf->getDbusPropertyVariant(
                             imageObjPath, "Activation", imageInterface);
-                        const auto& imageProp = std::get<std::string>(propVal);
-                        if (imageProp == "xyz.openbmc_project.Software."
-                                         "Activation.Activations.Ready" &&
-                            isCodeUpdateInProgress())
+                        if (isCodeUpdateInProgress())
                         {
                             newImageId = path.str;
                             if (!imageActivationMatch)
@@ -311,6 +308,11 @@
                             }
                             break;
                         }
+                        else
+                        {
+                            // Out of band update
+                            processRenameEvent();
+                        }
                     }
                     catch (const sdbusplus::exception_t& e)
                     {
@@ -324,6 +326,15 @@
         }));
 }
 
+void CodeUpdate::processRenameEvent()
+{
+    currBootSide = Pside;
+    auto sensorId = getBootSideRenameStateSensor();
+    sendStateSensorEvent(sensorId, PLDM_STATE_SENSOR_STATE, 0,
+                         PLDM_OEM_IBM_BOOT_SIDE_RENAME_STATE_RENAMED,
+                         PLDM_OEM_IBM_BOOT_SIDE_RENAME_STATE_NOT_RENAMED);
+}
+
 void CodeUpdate::processPriorityChangeNotification(
     const DbusChangedProps& chProperties)
 {