Adding system configuration object & UT
This commit adds the system config object that implements
the SystemConfiguration interface.
The hostname property under this interface will initially
be set from the bios table when the service starts.
Whenever user sets the property, the same will be updated
in the bios table.
busctl tree xyz.openbmc_project.Network.Hypervisor
└─/xyz
└─/xyz/openbmc_project
└─/xyz/openbmc_project/network
└─/xyz/openbmc_project/network/hypervisor
└─/xyz/openbmc_project/network/hypervisor/config
Tested By:
busctl set-property xyz.openbmc_project.Network.Hypervisor
/xyz/openbmc_project/network/hypervisor/config
xyz.openbmc_project.Network.SystemConfiguration HostName s "vmi HN"
busctl introspect xyz.openbmc_project.Network.Hypervisor /xyz/openbmc_project/network/hypervisor/config
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
org.freedesktop.DBus.Introspectable interface - - -
.Introspect method - s -
org.freedesktop.DBus.Peer interface - - -
.GetMachineId method - s -
.Ping method - - -
org.freedesktop.DBus.Properties interface - - -
.Get method ss v -
.GetAll method s a{sv} -
.Set method ssv - -
.PropertiesChanged signal sa{sv}as - -
xyz.openbmc_project.Network.SystemConfiguration interface - - -
.DefaultGateway property s "" emits-change writable
.DefaultGateway6 property s "" emits-change writable
.HostName property s "vmi HN" emits-change writable
busctl call xyz.openbmc_project.BIOSConfigManager /xyz/openbmc_project/bios_config/manager xyz.openbmc_project.BIOSConfig.Manager GetAttribute s vmi_hostname
svv "xyz.openbmc_project.BIOSConfig.Manager.AttributeType.String" s "vmi HN" s ""
Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
Change-Id: Ib3afaef2da039d18cc672a1759b721698f9c14e2
diff --git a/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.hpp b/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.hpp
index a1b4d9a..5616c66 100644
--- a/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.hpp
+++ b/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.hpp
@@ -1,5 +1,6 @@
#pragma once
+#include "hyp_sys_config.hpp"
#include "types.hpp"
#include "util.hpp"
@@ -13,6 +14,7 @@
{
class HypEthInterface;
+class HypSysConfig;
using biosAttrName = std::string;
using biosAttrType = std::string;
@@ -45,6 +47,8 @@
biosBaseOptions
};
+using SystemConfPtr = std::unique_ptr<HypSysConfig>;
+
/** @class Manager
* @brief Implementation for the
* xyz.openbmc_project.Network.Hypervisor DBus API.
@@ -104,6 +108,18 @@
*/
void createIfObjects();
+ /** @brief Creates system config object
+ */
+ void createSysConfObj();
+
+ /** @brief gets the system conf object.
+ *
+ */
+ const SystemConfPtr& getSystemConf()
+ {
+ return systemConf;
+ }
+
protected:
/**
* @brief get Dbus Prop
@@ -133,6 +149,9 @@
/** @brief object path */
std::string objectPath;
+ /** @brief pointer to system conf object. */
+ SystemConfPtr systemConf = nullptr;
+
/** @brief Persistent map of EthernetInterface dbus
* objects and their names
*/