Add Lock property to drives interface
This change adds the locked property, which is driven the same way the
volumes lock property is driven.
Tested:
busctl introspect xyz.openbmc_project.eStoraged /xyz/openbmc_project/inventory/storage/mmcblk0
.Locked property b false emits-change
busctl call xyz.openbmc_project.eStoraged /xyz/openbmc_project/inventory/storage/mmcblk0 xyz.openbmc_project.Inventory.Item.Volume Lock
.Locked property b true emits-change
Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: I750def0fd02cdfc36c060d162ef70fed34fa46c8
diff --git a/src/estoraged.cpp b/src/estoraged.cpp
index 7c26e8a..93efaae 100644
--- a/src/estoraged.cpp
+++ b/src/estoraged.cpp
@@ -83,6 +83,14 @@
driveInterface->register_property("Capacity", size);
driveInterface->register_property("PredictedMediaLifeLeftPercent",
lifeTime);
+ /* This registers the Locked property for the Drives interface.
+ * Now it is the same as the volume Locked property */
+ driveInterface->register_property_r(
+ "Locked", lockedProperty, sdbusplus::vtable::property_::emits_change,
+ [this](bool& value) {
+ value = this->isLocked();
+ return value;
+ });
driveInterface->register_property_r(
"EncryptionStatus", encryptionStatus,