update service: use return path for task callback
Currently the update service is using the start update path for
monitoring the activation interfaces, but instead it needs to use the
object path returned by start update API. By using the returned path the
changes to the activation interface are passed over to the task status.
For more details refer to design -
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/65738
https://gerrit.openbmc.org/c/openbmc/docs/+/65739
Tested:
Start update with ApplyTime as onReset
```
> curl -k -H "X-Auth-Token: $token" -H "Content-Type:multipart/form-data" -X POST -F UpdateParameters="{\"Targets\":[\"/redfish/v1/UpdateService/FirmwareInventory/3c956be0\"],\"@Redfish.OperationApplyTime\":\"OnReset\"};type=application/json" -F "UpdateFile=@obmc-phosphor-image-romulus-20240529184214.static.mtd.tar;type=application/octet-stream" https://${bmc}/redfish/v1/UpdateService/update
{
"@odata.id": "/redfish/v1/TaskService/Tasks/0",
"@odata.type": "#Task.v1_4_3.Task",
"Id": "0",
"TaskState": "Running",
"TaskStatus": "OK"
}
...
> curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/TaskService/Tasks/0
{
"@odata.id": "/redfish/v1/TaskService/Tasks/0",
"@odata.type": "#Task.v1_4_3.Task",
"EndTime": "2024-08-12T07:35:42+00:00",
"HidePayload": false,
"Id": "0",
"Messages": [
...
},
"PercentComplete": 100,
"StartTime": "2024-08-12T07:35:15+00:00",
"TaskMonitor": "/redfish/v1/TaskService/TaskMonitors/0",
"TaskState": "Completed",
"TaskStatus": "OK"
}
```
Change-Id: Ib17c5da329361fc59b0a1923ace214a8bf9e8371
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index fbea2e3..f44615d 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -831,8 +831,9 @@
return;
}
- BMCWEB_LOG_INFO("Call to StartUpdate Success, retPath = {}", retPath.str);
- createTask(asyncResp, std::move(payload), objectPath);
+ BMCWEB_LOG_INFO("Call to StartUpdate on {} Success, retPath = {}",
+ objectPath, retPath.str);
+ createTask(asyncResp, std::move(payload), retPath);
}
inline void startUpdate(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,