PEL: Read 'HMC Managed' BIOS attribute

Add a property watch on the base BaseBIOSTable property provided by the
BIOS config manager so that the pvm_hmc_managed BIOS attribute can be
read from it to know if the HMC is managed or not.

The DataInterface class already provides an isHMCManaged() method that
is used by the host notification code, and this commit allows it to
return the correct value.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I55e8f222361e901f0b28c3d596dc3400093aba89
diff --git a/extensions/openpower-pels/data_interface.cpp b/extensions/openpower-pels/data_interface.cpp
index a582d88..f49bcca 100644
--- a/extensions/openpower-pels/data_interface.cpp
+++ b/extensions/openpower-pels/data_interface.cpp
@@ -44,6 +44,7 @@
 constexpr auto logSetting = "xyz.openbmc_project.Settings";
 constexpr auto hwIsolation = "org.open_power.HardwareIsolation";
 constexpr auto bootRawProgress = "xyz.openbmc_project.State.Boot.Raw";
+constexpr auto biosConfigMgr = "xyz.openbmc_project.BIOSConfigManager";
 } // namespace service_name
 
 namespace object_path
@@ -64,6 +65,7 @@
 constexpr auto logSetting = "/xyz/openbmc_project/logging/settings";
 constexpr auto hwIsolation = "/xyz/openbmc_project/hardware_isolation";
 constexpr auto bootRawSetting = "/xyz/openbmc_project/state/boot/raw0";
+constexpr auto biosConfigMgr = "/xyz/openbmc_project/bios_config/manager";
 } // namespace object_path
 
 namespace interface
@@ -96,6 +98,7 @@
 constexpr auto bootRawProgress = "xyz.openbmc_project.State.Boot.Raw";
 constexpr auto hwIsolationEntry = "xyz.openbmc_project.HardwareIsolation.Entry";
 constexpr auto association = "xyz.openbmc_project.Association";
+constexpr auto biosConfigMgr = "xyz.openbmc_project.BIOSConfig.Manager";
 } // namespace interface
 
 using namespace sdbusplus::xyz::openbmc_project::State::Boot::server;
@@ -188,6 +191,26 @@
         *this, [this](const auto& value) {
             this->_hostState = std::get<std::string>(value);
         }));
+
+    // Watch the BaseBIOSTable property for the hmc managed attribute
+    _properties.emplace_back(std::make_unique<PropertyWatcher<DataInterface>>(
+        bus, object_path::biosConfigMgr, interface::biosConfigMgr,
+        "BaseBIOSTable", service_name::biosConfigMgr, *this,
+        [this](const auto& value) {
+            const auto& attributes = std::get<BiosAttributes>(value);
+
+            auto it = attributes.find("pvm_hmc_managed");
+            if (it != attributes.end())
+            {
+                const auto& currentValVariant = std::get<5>(it->second);
+                auto currentVal = std::get_if<std::string>(&currentValVariant);
+                if (currentVal)
+                {
+                    this->_hmcManaged =
+                        (*currentVal == "Enabled") ? true : false;
+                }
+            }
+        }));
 }
 
 DBusPropertyMap