diff options
author | Ed Tanous <ed.tanous@intel.com> | 2019-07-31 20:43:37 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2019-08-01 18:19:38 +0300 |
commit | d0f63ef62c76c932a2003eaa42c0b250065ae06f (patch) | |
tree | 4c0e3cb32dc80f80460bdbf82ff6d401d4ff194f /meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0049-Fix-Unspecified-error-on-ipmi-restart-cause-command.patch | |
parent | b4f66bacb1b8e661d794fa7a189e2f66f5092e2e (diff) | |
download | openbmc-d0f63ef62c76c932a2003eaa42c0b250065ae06f.tar.xz |
Update to internal 7-31-19
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0049-Fix-Unspecified-error-on-ipmi-restart-cause-command.patch')
-rw-r--r-- | meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0049-Fix-Unspecified-error-on-ipmi-restart-cause-command.patch | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0049-Fix-Unspecified-error-on-ipmi-restart-cause-command.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0049-Fix-Unspecified-error-on-ipmi-restart-cause-command.patch deleted file mode 100644 index aba5eb095..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0049-Fix-Unspecified-error-on-ipmi-restart-cause-command.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 59287a8869b5253a1b4203e0cc8a92f063dcc7e6 Mon Sep 17 00:00:00 2001 -From: Yong Li <yong.b.li@linux.intel.com> -Date: Tue, 25 Sep 2018 16:08:22 +0800 -Subject: [PATCH] Fix "Unspecified error" on ipmi restart cause command - -Needs to convert the dbus value(enum) into ipmi value(uint8) - -Tested by: -ipmitool chassis restart_cause - -Signed-off-by: Yong Li <yong.b.li@linux.intel.com> ---- - chassishandler.cpp | 28 ++++++++++++++++++++++++++-- - 1 file changed, 26 insertions(+), 2 deletions(-) - -diff --git a/chassishandler.cpp b/chassishandler.cpp -index 40eb4f5..c3d4931 100644 ---- a/chassishandler.cpp -+++ b/chassishandler.cpp -@@ -106,7 +106,7 @@ static constexpr auto match = "chassis0"; - const static constexpr char* stateHostInterface = - "xyz.openbmc_project.State.Host"; - const static constexpr char* hostRestartCauseInterface = -- "xyz.openbmc_project.State.Host.HostRestartCause"; -+ "xyz.openbmc_project.State.Host"; - const static constexpr char* hostRestartCause = "HostRestartCause"; - const static constexpr char chassisCapIntf[] = - "xyz.openbmc_project.Control.ChassisCapabilities"; -@@ -1764,6 +1764,26 @@ ipmi_ret_t ipmi_chassis_set_sys_boot_options(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - return rc; - } - -+namespace restart_cause -+{ -+ -+using namespace sdbusplus::xyz::openbmc_project::State::server; -+ -+std::map<Host::RestartCause, uint8_t> dbusToIpmi = { -+ {Host::RestartCause::Unknown, 0x0}, -+ {Host::RestartCause::IpmiCommand, 0x1}, -+ {Host::RestartCause::ResetButton, 0x2}, -+ {Host::RestartCause::PowerButton, 0x3}, -+ {Host::RestartCause::WatchdogTimer, 0x4}, -+ {Host::RestartCause::OEM, 0x5}, -+ {Host::RestartCause::PowerPolicyAlwaysOn, 0x6}, -+ {Host::RestartCause::PowerPolicyPreviousState, 0x7}, -+ {Host::RestartCause::PEFReset, 0x8}, -+ {Host::RestartCause::PEFPowerCycle, 0x9}, -+ {Host::RestartCause::SoftReset, 0xa}, -+ {Host::RestartCause::RTCWakeup, 0xb}}; -+} // namespace restart_cause -+ - ipmi_ret_t ipmi_chassis_get_sys_restart_cause( - ipmi_netfn_t netfn, ipmi_cmd_t cmd, ipmi_request_t request, - ipmi_response_t response, ipmi_data_len_t data_len, ipmi_context_t context) -@@ -1787,7 +1807,11 @@ ipmi_ret_t ipmi_chassis_get_sys_restart_cause( - ipmi::Value variant = - ipmi::getDbusProperty(bus, hostObject.second, hostObject.first, - hostRestartCauseInterface, hostRestartCause); -- resp->restartCause = variant.get<uint8_t>(); -+ -+ std::string restartCause = -+ sdbusplus::message::variant_ns::get<std::string>(variant); -+ resp->restartCause = restart_cause::dbusToIpmi.at( -+ restart_cause::Host::convertRestartCauseFromString(restartCause)); - } - - catch (std::exception& e) --- -2.7.4 - |