summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnathan Mantey <johnathanx.mantey@intel.com>2018-12-10 15:49:34 -0800
committerJohnathan Mantey <johnathanx.mantey@intel.com>2019-02-04 11:52:28 -0800
commitf92261dc449bc4579249101997da0648718dee2f (patch)
tree13b3872c5cb06c37a67e89b8365c1a7f1b75d507
parente19540e6d8e96e205978712a698e83f676553360 (diff)
downloadphosphor-host-ipmid-f92261dc449bc4579249101997da0648718dee2f.tar.gz
phosphor-host-ipmid-f92261dc449bc4579249101997da0648718dee2f.zip
Update DBus initialization and use
The DBus instance variable is no longer a passed parameter to instance methods. Instance methods can access the private DBus variable directly. Change-Id: Id0c988802e5ad6c2757e7a243ee92331f447ac0d Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
-rw-r--r--user_channel/channel_mgmt.cpp15
-rw-r--r--user_channel/channel_mgmt.hpp8
2 files changed, 7 insertions, 16 deletions
diff --git a/user_channel/channel_mgmt.cpp b/user_channel/channel_mgmt.cpp
index 20e58b0..697219c 100644
--- a/user_channel/channel_mgmt.cpp
+++ b/user_channel/channel_mgmt.cpp
@@ -605,8 +605,8 @@ ipmi_ret_t ChannelConfig::setChannelAccessPersistData(
"/" + channelData[chNum].chName;
try
{
- if (0 != setDbusProperty(bus, networkIntfServiceName,
- networkIntfObj, networkChConfigIntfName,
+ if (0 != setDbusProperty(networkIntfServiceName, networkIntfObj,
+ networkChConfigIntfName,
privilegePropertyString, privStr))
{
log<level::DEBUG>(
@@ -972,7 +972,6 @@ int ChannelConfig::readChannelVolatileData()
log<level::DEBUG>("Error in opening IPMI Channel data file");
return -EIO;
}
-
try
{
// Fill in global structure
@@ -1041,7 +1040,6 @@ int ChannelConfig::readChannelPersistData()
log<level::DEBUG>("Error in opening IPMI Channel data file");
return -EIO;
}
-
try
{
// Fill in global structure
@@ -1238,8 +1236,7 @@ int ChannelConfig::checkAndReloadVolatileData()
return ret;
}
-int ChannelConfig::setDbusProperty(sdbusplus::bus::bus& bus,
- const std::string& service,
+int ChannelConfig::setDbusProperty(const std::string& service,
const std::string& objPath,
const std::string& interface,
const std::string& property,
@@ -1268,8 +1265,7 @@ int ChannelConfig::setDbusProperty(sdbusplus::bus::bus& bus,
return 0;
}
-int ChannelConfig::getDbusProperty(sdbusplus::bus::bus& bus,
- const std::string& service,
+int ChannelConfig::getDbusProperty(const std::string& service,
const std::string& objPath,
const std::string& interface,
const std::string& property,
@@ -1314,8 +1310,7 @@ int ChannelConfig::syncNetworkChannelConfig()
std::string(networkIntfObjectBasePath) + "/" +
channelData[chNum].chName;
DbusVariant variant;
- if (0 != getDbusProperty(bus, networkIntfServiceName,
- networkIntfObj,
+ if (0 != getDbusProperty(networkIntfServiceName, networkIntfObj,
networkChConfigIntfName,
privilegePropertyString, variant))
{
diff --git a/user_channel/channel_mgmt.hpp b/user_channel/channel_mgmt.hpp
index 02f951b..8b81391 100644
--- a/user_channel/channel_mgmt.hpp
+++ b/user_channel/channel_mgmt.hpp
@@ -308,7 +308,6 @@ class ChannelConfig
/** @brief function to set D-Bus property value
*
- * @param[in] bus - bus
* @param[in] service - service name
* @param[in] objPath - object path
* @param[in] interface - interface
@@ -317,14 +316,12 @@ class ChannelConfig
*
* @return 0 for success, -errno for failure.
*/
- int setDbusProperty(sdbusplus::bus::bus& bus, const std::string& service,
- const std::string& objPath,
+ int setDbusProperty(const std::string& service, const std::string& objPath,
const std::string& interface,
const std::string& property, const DbusVariant& value);
/** @brief function to get D-Bus property value
*
- * @param[in] bus - bus
* @param[in] service - service name
* @param[in] objPath - object path
* @param[in] interface - interface
@@ -333,8 +330,7 @@ class ChannelConfig
*
* @return 0 for success, -errno for failure.
*/
- int getDbusProperty(sdbusplus::bus::bus& bus, const std::string& service,
- const std::string& objPath,
+ int getDbusProperty(const std::string& service, const std::string& objPath,
const std::string& interface,
const std::string& property, DbusVariant& value);
OpenPOWER on IntegriCloud