diff options
author | Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com> | 2017-03-31 11:34:48 +0530 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-04-04 03:26:28 +0000 |
commit | b891a576f6e23f4a2ebda105236767a503185685 (patch) | |
tree | 1fe7badd6ce49af56196749ed224d93b5a016ec8 | |
parent | 504ebc2a21d50616f57ca2f2ae4959a99fb064c9 (diff) | |
download | phosphor-host-ipmid-b891a576f6e23f4a2ebda105236767a503185685.tar.gz phosphor-host-ipmid-b891a576f6e23f4a2ebda105236767a503185685.zip |
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>
-rw-r--r-- | chassishandler.cpp | 9 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | systemintfcmds.cpp | 7 |
3 files changed, 8 insertions, 10 deletions
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 @@ finish: //------------------------------------------------------------- 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 @@ int stop_soft_off_timer() 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 @@ AS_IF([test "x$enable_softoff" != "xno"], # 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 @@ ipmi_ret_t ipmi_app_read_event(ipmi_netfn_t netfn, ipmi_cmd_t cmd, // 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 @@ ipmi_ret_t ipmi_app_read_event(ipmi_netfn_t netfn, ipmi_cmd_t cmd, // 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) |