Populate the Type property in Item.Drive interface
By populating this property, bmcweb can populate the "MediaType"
property in the Drive schema.
Tested:
$ busctl get-property xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Drive Type
s "xyz.openbmc_project.Inventory.Item.Drive.DriveType.SSD"
$ curl http://localhost:80/redfish/v1/Chassis/DCSCM/Drives/mmcblk0
{
...
"MediaType": "SSD",
...
}
Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: I2cb6c7d3ec3b49e8d666da940d873f1117a0aa85
diff --git a/src/estoraged.cpp b/src/estoraged.cpp
index f9c69dc..d2ff1ef 100644
--- a/src/estoraged.cpp
+++ b/src/estoraged.cpp
@@ -38,7 +38,7 @@
uint8_t lifeTime, const std::string& partNumber,
const std::string& serialNumber,
const std::string& locationCode, uint64_t eraseMaxGeometry,
- uint64_t eraseMinGeometry,
+ uint64_t eraseMinGeometry, const std::string& driveType,
std::unique_ptr<CryptsetupInterface> cryptInterface,
std::unique_ptr<FilesystemInterface> fsInterface) :
devPath(devPath),
@@ -87,6 +87,9 @@
driveInterface->register_property("Capacity", size);
driveInterface->register_property("PredictedMediaLifeLeftPercent",
lifeTime);
+ driveInterface->register_property(
+ "Type",
+ "xyz.openbmc_project.Inventory.Item.Drive.DriveType." + driveType);
/* This registers the Locked property for the Drives interface.
* Now it is the same as the volume Locked property */
driveInterface->register_property_r(