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/include/util.hpp b/include/util.hpp
index 8f5a0ff..7cc778a 100644
--- a/include/util.hpp
+++ b/include/util.hpp
@@ -18,14 +18,16 @@
std::string locationCode;
uint64_t eraseMaxGeometry;
uint64_t eraseMinGeometry;
+ std::string driveType;
DeviceInfo(std::filesystem::path& deviceFile,
std::filesystem::path& sysfsDir, std::string& luksName,
std::string& locationCode, uint64_t eraseMaxGeometry,
- uint64_t eraseMinGeometry) :
+ uint64_t eraseMinGeometry, std::string& driveType) :
deviceFile(deviceFile),
sysfsDir(sysfsDir), luksName(luksName), locationCode(locationCode),
- eraseMaxGeometry(eraseMaxGeometry), eraseMinGeometry(eraseMinGeometry)
+ eraseMaxGeometry(eraseMaxGeometry), eraseMinGeometry(eraseMinGeometry),
+ driveType(driveType)
{}
};