Populate Protocol property in Item.Drive interface
By populating this property, bmcweb can populate the "Protocol"
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 Protocol
s "xyz.openbmc_project.Inventory.Item.Drive.DriveProtocol.eMMC"
Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: I2bd19190c445ce57f3d867ffbb437c1a4a370b51
diff --git a/src/main.cpp b/src/main.cpp
index cb37791..6d92ecf 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -99,12 +99,13 @@
std::string partNumber = estoraged::util::getPartNumber(sysfsDir);
std::string serialNumber =
estoraged::util::getSerialNumber(sysfsDir);
- std::string driveType = deviceInfo->driveType;
+ const std::string& driveType = deviceInfo->driveType;
+ const std::string& driveProtocol = deviceInfo->driveProtocol;
/* Create the storage object. */
storageObjects[path] = std::make_unique<estoraged::EStoraged>(
objectServer, path, deviceFile, luksName, size, lifeleft,
partNumber, serialNumber, locationCode, eraseMaxGeometry,
- eraseMinGeometry, driveType);
+ eraseMinGeometry, driveType, driveProtocol);
lg2::info("Created eStoraged object for path {PATH}", "PATH", path,
"REDFISH_MESSAGE_ID",
std::string("OpenBMC.0.1.CreateStorageObjects"));