Add storage inventory support for hsbp-manager
Added storage inventory support for hsbp manager
Recently there is a upstream code changes done for
multiple storage support in bmcweb. So Added the storage
inventory interface as
/xyz/openbmc_project/inventory/item/storage/hsbp/1
in hsbp-manager.
get: https://{bmc_ip}/redfish/v1/Systems/system/Storage
{
"@odata.id": "/redfish/v1/Systems/system/Storage",
"@odata.type": "#StorageCollection.StorageCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Systems/system/Storage/1"
}
],
"Members@odata.count": 1,
"Name": "Storage Collection"
}
get: https://{bmc_ip}/redfish/v1/Systems/system/Storage/1
{
"@odata.id": "/redfish/v1/Systems/system/Storage/1",
"@odata.type": "#Storage.v1_13_0.Storage",
"Controllers": {
"@odata.id": "/redfish/v1/Systems/system/Storage/1/
Controllers"
},
"Drives": [
{
"@odata.id": "/redfish/v1/Systems/system/Storage/1
/Drives/Drive_1"
},
{
"@odata.id": "/redfish/v1/Systems/system/Storage/1
/Drives/Drive_2"
}
],
"Drives@odata.count": 2,
"Id": "1",
"Name": "Storage",
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
}
}
Redfish Validator: passed
Change-Id: I086ef93952767e8b676ab6fb1dba244ac416d032
Signed-off-by: Dileep Kumar Choppa <dileepx.kumar.choppa@intel.com>
diff --git a/hsbp-manager/src/hsbp_manager.cpp b/hsbp-manager/src/hsbp_manager.cpp
index c14397d..2f615d2 100644
--- a/hsbp-manager/src/hsbp_manager.cpp
+++ b/hsbp-manager/src/hsbp_manager.cpp
@@ -2854,10 +2854,14 @@
/* Set the Dbus name */
conn->request_name(busName);
+ std::shared_ptr<sdbusplus::asio::dbus_interface> storageIface;
+
/* Add interface for storage inventory */
- objServer.add_interface("/xyz/openbmc_project/inventory/item/storage",
+ storageIface = objServer.add_interface("/xyz/openbmc_project/inventory/item/storage/hsbp/1",
"xyz.openbmc_project.inventory.item.storage");
+ storageIface->initialize();
+
/* HSBP initializtion flow:
* 1. Register GPIO event callback on FM_SMB_BMC_NVME_LVC3_ALERT_N line
* 2. Set up Dbus match for power - determine if host is up and running