IPMI: Update the dbus object for soft power off with underscores
Fixes openbmc/phosphor-host-ipmid#102
Change-Id: I3e7456401b7265a51578f9aa08bef2ae3f326849
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/chassishandler.cpp b/chassishandler.cpp
index 39b2994..3d3e192 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -13,6 +13,7 @@
#include <array>
#include <phosphor-logging/log.hpp>
#include <xyz/openbmc_project/State/Host/server.hpp>
+#include "config.h"
//Defines
#define SET_PARM_VERSION 0x01
@@ -803,8 +804,6 @@
//-------------------------------------------------------------
int stop_soft_off_timer()
{
- constexpr auto objname = "/xyz/openbmc_project/ipmi/internal/"
- "softpoweroff";
constexpr auto iface = "org.freedesktop.DBus.Properties";
constexpr auto soft_off_iface = "xyz.openbmc_project.Ipmi.Internal."
"SoftPowerOff";
@@ -818,15 +817,15 @@
auto bus = ipmid_get_sd_bus_connection();
// Get the service name
- auto r = mapper_get_service(bus, objname, &busname);
+ auto r = mapper_get_service(bus, SOFTOFF_OBJPATH, &busname);
if (r < 0) {
fprintf(stderr, "Failed to get %s bus name: %s\n",
- objname, strerror(-r));
+ SOFTOFF_OBJPATH, strerror(-r));
return r;
}
// No error object or reply expected.
- int rc = sd_bus_call_method(bus, busname, objname, iface,
+ int rc = sd_bus_call_method(bus, busname, SOFTOFF_OBJPATH, iface,
"Set", nullptr, nullptr, "ssv",
soft_off_iface, property, "s", value);
if (rc < 0)
diff --git a/configure.ac b/configure.ac
index 422f0e1..882b01e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -88,7 +88,7 @@
# Service dbus root
[AC_ARG_VAR(SOFTOFF_OBJPATH, [The SoftPowerOff Dbus root])]
AS_IF([test "x$SOFTOFF_OBJPATH" == "x"],
- [SOFTOFF_OBJPATH="/xyz/openbmc_project/ipmi/internal/softpoweroff"])
+ [SOFTOFF_OBJPATH="/xyz/openbmc_project/ipmi/internal/soft_power_off"])
[AC_DEFINE_UNQUOTED([SOFTOFF_OBJPATH], ["$SOFTOFF_OBJPATH"], [The SoftPowerOff Dbus root])]
# Timeouts in SECONDS for SoftPowerOff protocol
diff --git a/systemintfcmds.cpp b/systemintfcmds.cpp
index 07ecec8..62d9524 100644
--- a/systemintfcmds.cpp
+++ b/systemintfcmds.cpp
@@ -1,5 +1,6 @@
#include "systemintfcmds.h"
#include "host-ipmid/ipmid-api.h"
+#include "config.h"
#include <stdio.h>
#include <mapper.h>
@@ -21,8 +22,6 @@
// mechanism. If we need to make this generically used for some
// other conditions, then we can take advantage of context pointer.
- constexpr auto objname = "/xyz/openbmc_project/ipmi/internal/"
- "softpoweroff";
constexpr auto iface = "org.freedesktop.DBus.Properties";
constexpr auto soft_off_iface = "xyz.openbmc_project.Ipmi.Internal."
"SoftPowerOff";
@@ -41,11 +40,11 @@
// Nudge the SoftPowerOff application that it needs to stop the
// initial watchdog timer. If we have some errors talking to Soft Off
// object, get going and do our regular job
- mapper_get_service(bus, objname, &busname);
+ mapper_get_service(bus, SOFTOFF_OBJPATH, &busname);
if (busname)
{
// No error object or reply expected.
- auto r = sd_bus_call_method(bus, busname, objname, iface,
+ auto r = sd_bus_call_method(bus, busname, SOFTOFF_OBJPATH, iface,
"Set", nullptr, nullptr, "ssv",
soft_off_iface, property, "s", value);
if (r < 0)