Andrew Geissler | 0029a5d | 2017-01-24 14:48:35 -0600 | [diff] [blame] | 1 | #include <sdbusplus/bus.hpp> |
William A. Kennington III | 09568ff | 2018-05-11 00:03:12 -0700 | [diff] [blame] | 2 | #include <sdbusplus/exception.hpp> |
Saqib Khan | a8006a2 | 2017-02-14 11:37:08 -0600 | [diff] [blame] | 3 | #include <phosphor-logging/log.hpp> |
Nagaraju Goruganti | cb781fe | 2018-04-06 13:41:01 -0500 | [diff] [blame] | 4 | #include <phosphor-logging/elog-errors.hpp> |
| 5 | #include "xyz/openbmc_project/Common/error.hpp" |
Andrew Geissler | a90a31a | 2016-12-13 16:16:28 -0600 | [diff] [blame] | 6 | #include "chassis_state_manager.hpp" |
Nagaraju Goruganti | cb781fe | 2018-04-06 13:41:01 -0500 | [diff] [blame] | 7 | #include <cereal/archives/json.hpp> |
| 8 | #include <fstream> |
| 9 | #include "config.h" |
| 10 | #include <experimental/filesystem> |
| 11 | |
Andrew Geissler | a90a31a | 2016-12-13 16:16:28 -0600 | [diff] [blame] | 12 | namespace phosphor |
| 13 | { |
| 14 | namespace state |
| 15 | { |
| 16 | namespace manager |
| 17 | { |
| 18 | |
| 19 | // When you see server:: you know we're referencing our base class |
| 20 | namespace server = sdbusplus::xyz::openbmc_project::State::server; |
| 21 | |
| 22 | using namespace phosphor::logging; |
William A. Kennington III | 09568ff | 2018-05-11 00:03:12 -0700 | [diff] [blame] | 23 | using sdbusplus::exception::SdBusError; |
Andrew Geissler | a90a31a | 2016-12-13 16:16:28 -0600 | [diff] [blame] | 24 | |
Josh D. King | 6838ea9 | 2017-04-11 13:39:18 -0500 | [diff] [blame] | 25 | constexpr auto CHASSIS_STATE_POWEROFF_TGT = "obmc-chassis-poweroff@0.target"; |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 26 | constexpr auto CHASSIS_STATE_HARD_POWEROFF_TGT = |
| 27 | "obmc-chassis-hard-poweroff@0.target"; |
Josh D. King | 6838ea9 | 2017-04-11 13:39:18 -0500 | [diff] [blame] | 28 | constexpr auto CHASSIS_STATE_POWERON_TGT = "obmc-chassis-poweron@0.target"; |
Andrew Geissler | 0029a5d | 2017-01-24 14:48:35 -0600 | [diff] [blame] | 29 | |
Josh D. King | 697474c | 2017-03-02 11:15:55 -0600 | [diff] [blame] | 30 | constexpr auto ACTIVE_STATE = "active"; |
| 31 | constexpr auto ACTIVATING_STATE = "activating"; |
| 32 | |
Andrew Geissler | ce80f24 | 2017-01-24 13:25:33 -0600 | [diff] [blame] | 33 | /* Map a transition to it's systemd target */ |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 34 | const std::map<server::Chassis::Transition, std::string> SYSTEMD_TARGET_TABLE = |
| 35 | { |
Andrew Geissler | 8cf2f9a | 2017-07-21 11:58:04 -0500 | [diff] [blame] | 36 | // Use the hard off target to ensure we shutdown immediately |
| 37 | {server::Chassis::Transition::Off, CHASSIS_STATE_HARD_POWEROFF_TGT}, |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 38 | {server::Chassis::Transition::On, CHASSIS_STATE_POWERON_TGT}}; |
Andrew Geissler | ce80f24 | 2017-01-24 13:25:33 -0600 | [diff] [blame] | 39 | |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 40 | constexpr auto SYSTEMD_SERVICE = "org.freedesktop.systemd1"; |
| 41 | constexpr auto SYSTEMD_OBJ_PATH = "/org/freedesktop/systemd1"; |
Andrew Geissler | ce80f24 | 2017-01-24 13:25:33 -0600 | [diff] [blame] | 42 | constexpr auto SYSTEMD_INTERFACE = "org.freedesktop.systemd1.Manager"; |
| 43 | |
Josh D. King | 697474c | 2017-03-02 11:15:55 -0600 | [diff] [blame] | 44 | constexpr auto SYSTEMD_PROPERTY_IFACE = "org.freedesktop.DBus.Properties"; |
| 45 | constexpr auto SYSTEMD_INTERFACE_UNIT = "org.freedesktop.systemd1.Unit"; |
| 46 | |
Andrew Geissler | 0029a5d | 2017-01-24 14:48:35 -0600 | [diff] [blame] | 47 | void Chassis::subscribeToSystemdSignals() |
Andrew Geissler | 2ec3a7e | 2016-12-13 22:01:28 -0600 | [diff] [blame] | 48 | { |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 49 | auto method = this->bus.new_method_call(SYSTEMD_SERVICE, SYSTEMD_OBJ_PATH, |
| 50 | SYSTEMD_INTERFACE, "Subscribe"); |
Andrew Geissler | 0029a5d | 2017-01-24 14:48:35 -0600 | [diff] [blame] | 51 | this->bus.call_noreply(method); |
Andrew Geissler | 2ec3a7e | 2016-12-13 22:01:28 -0600 | [diff] [blame] | 52 | |
Andrew Geissler | 0029a5d | 2017-01-24 14:48:35 -0600 | [diff] [blame] | 53 | return; |
Andrew Geissler | 2ec3a7e | 2016-12-13 22:01:28 -0600 | [diff] [blame] | 54 | } |
| 55 | |
Andrew Geissler | dff50ed | 2016-12-13 20:39:04 -0600 | [diff] [blame] | 56 | // TODO - Will be rewritten once sdbusplus client bindings are in place |
| 57 | // and persistent storage design is in place and sdbusplus |
| 58 | // has read property function |
| 59 | void Chassis::determineInitialState() |
| 60 | { |
| 61 | sdbusplus::message::variant<int> pgood = -1; |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 62 | auto method = this->bus.new_method_call( |
| 63 | "org.openbmc.control.Power", "/org/openbmc/control/power0", |
| 64 | "org.freedesktop.DBus.Properties", "Get"); |
Andrew Geissler | dff50ed | 2016-12-13 20:39:04 -0600 | [diff] [blame] | 65 | |
| 66 | method.append("org.openbmc.control.Power", "pgood"); |
William A. Kennington III | 09568ff | 2018-05-11 00:03:12 -0700 | [diff] [blame] | 67 | try |
| 68 | { |
William A. Kennington III | 9a2f37c | 2018-06-28 16:18:37 -0700 | [diff] [blame] | 69 | auto reply = this->bus.call(method); |
| 70 | if (reply.is_method_error()) |
| 71 | { |
| 72 | log<level::ERR>( |
| 73 | "Error in response message - could not get initial pgood"); |
| 74 | goto fail; |
| 75 | } |
| 76 | |
| 77 | try |
| 78 | { |
| 79 | reply.read(pgood); |
| 80 | } |
| 81 | catch (const SdBusError& e) |
| 82 | { |
| 83 | log<level::ERR>("Error in bus response - bad encoding of pgood", |
| 84 | entry("ERROR=%s", e.what()), |
| 85 | entry("REPLY_SIG=%s", reply.get_signature())); |
| 86 | goto fail; |
| 87 | } |
| 88 | |
| 89 | if (pgood == 1) |
| 90 | { |
| 91 | log<level::INFO>("Initial Chassis State will be On", |
| 92 | entry("CHASSIS_CURRENT_POWER_STATE=%s", |
| 93 | convertForMessage(PowerState::On).c_str())); |
| 94 | server::Chassis::currentPowerState(PowerState::On); |
| 95 | server::Chassis::requestedPowerTransition(Transition::On); |
| 96 | return; |
| 97 | } |
William A. Kennington III | 09568ff | 2018-05-11 00:03:12 -0700 | [diff] [blame] | 98 | } |
| 99 | catch (const SdBusError& e) |
| 100 | { |
William A. Kennington III | 9a2f37c | 2018-06-28 16:18:37 -0700 | [diff] [blame] | 101 | // It's acceptable for the pgood state service to not be available |
| 102 | // since it will notify us of the pgood state when it comes up. |
| 103 | if (e.name() != nullptr && |
| 104 | strcmp("org.freedesktop.DBus.Error.ServiceUnknown", e.name()) == 0) |
| 105 | { |
| 106 | goto fail; |
| 107 | } |
Andrew Geissler | dff50ed | 2016-12-13 20:39:04 -0600 | [diff] [blame] | 108 | |
William A. Kennington III | 9a2f37c | 2018-06-28 16:18:37 -0700 | [diff] [blame] | 109 | // Only log for unexpected error types. |
| 110 | log<level::ERR>("Error performing call to get pgood", |
| 111 | entry("ERROR=%s", e.what())); |
| 112 | goto fail; |
Andrew Geissler | dff50ed | 2016-12-13 20:39:04 -0600 | [diff] [blame] | 113 | } |
William A. Kennington III | 09568ff | 2018-05-11 00:03:12 -0700 | [diff] [blame] | 114 | |
| 115 | fail: |
| 116 | log<level::INFO>("Initial Chassis State will be Off", |
| 117 | entry("CHASSIS_CURRENT_POWER_STATE=%s", |
| 118 | convertForMessage(PowerState::Off).c_str())); |
| 119 | server::Chassis::currentPowerState(PowerState::Off); |
| 120 | server::Chassis::requestedPowerTransition(Transition::Off); |
Andrew Geissler | dff50ed | 2016-12-13 20:39:04 -0600 | [diff] [blame] | 121 | |
| 122 | return; |
| 123 | } |
| 124 | |
Andrew Geissler | ce80f24 | 2017-01-24 13:25:33 -0600 | [diff] [blame] | 125 | void Chassis::executeTransition(Transition tranReq) |
| 126 | { |
| 127 | auto sysdTarget = SYSTEMD_TARGET_TABLE.find(tranReq)->second; |
| 128 | |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 129 | auto method = this->bus.new_method_call(SYSTEMD_SERVICE, SYSTEMD_OBJ_PATH, |
| 130 | SYSTEMD_INTERFACE, "StartUnit"); |
Andrew Geissler | ce80f24 | 2017-01-24 13:25:33 -0600 | [diff] [blame] | 131 | |
| 132 | method.append(sysdTarget); |
| 133 | method.append("replace"); |
| 134 | |
| 135 | this->bus.call_noreply(method); |
| 136 | |
| 137 | return; |
| 138 | } |
| 139 | |
Josh D. King | 697474c | 2017-03-02 11:15:55 -0600 | [diff] [blame] | 140 | bool Chassis::stateActive(const std::string& target) |
| 141 | { |
| 142 | sdbusplus::message::variant<std::string> currentState; |
| 143 | sdbusplus::message::object_path unitTargetPath; |
| 144 | |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 145 | auto method = this->bus.new_method_call(SYSTEMD_SERVICE, SYSTEMD_OBJ_PATH, |
| 146 | SYSTEMD_INTERFACE, "GetUnit"); |
Josh D. King | 697474c | 2017-03-02 11:15:55 -0600 | [diff] [blame] | 147 | |
| 148 | method.append(target); |
| 149 | auto result = this->bus.call(method); |
| 150 | |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 151 | // Check that the bus call didn't result in an error |
| 152 | if (result.is_method_error()) |
Josh D. King | 697474c | 2017-03-02 11:15:55 -0600 | [diff] [blame] | 153 | { |
| 154 | log<level::ERR>("Error in bus call - could not resolve GetUnit for:", |
| 155 | entry(" %s", SYSTEMD_INTERFACE)); |
| 156 | return false; |
| 157 | } |
| 158 | |
William A. Kennington III | 09568ff | 2018-05-11 00:03:12 -0700 | [diff] [blame] | 159 | try |
| 160 | { |
| 161 | result.read(unitTargetPath); |
| 162 | } |
| 163 | catch (const SdBusError& e) |
| 164 | { |
| 165 | log<level::ERR>("Error in bus response - bad encoding for GetUnit", |
| 166 | entry("ERROR=%s", e.what()), |
| 167 | entry("REPLY_SIG=%s", result.get_signature())); |
| 168 | return false; |
| 169 | } |
Josh D. King | 697474c | 2017-03-02 11:15:55 -0600 | [diff] [blame] | 170 | |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 171 | method = this->bus.new_method_call( |
| 172 | SYSTEMD_SERVICE, |
| 173 | static_cast<const std::string&>(unitTargetPath).c_str(), |
| 174 | SYSTEMD_PROPERTY_IFACE, "Get"); |
Josh D. King | 697474c | 2017-03-02 11:15:55 -0600 | [diff] [blame] | 175 | |
| 176 | method.append(SYSTEMD_INTERFACE_UNIT, "ActiveState"); |
| 177 | result = this->bus.call(method); |
| 178 | |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 179 | // Check that the bus call didn't result in an error |
| 180 | if (result.is_method_error()) |
Josh D. King | 697474c | 2017-03-02 11:15:55 -0600 | [diff] [blame] | 181 | { |
| 182 | log<level::ERR>("Error in bus call - could not resolve Get for:", |
| 183 | entry(" %s", SYSTEMD_PROPERTY_IFACE)); |
| 184 | return false; |
| 185 | } |
| 186 | |
| 187 | result.read(currentState); |
| 188 | |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 189 | if (currentState != ACTIVE_STATE && currentState != ACTIVATING_STATE) |
Josh D. King | 697474c | 2017-03-02 11:15:55 -0600 | [diff] [blame] | 190 | { |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 191 | // False - not active |
Josh D. King | 697474c | 2017-03-02 11:15:55 -0600 | [diff] [blame] | 192 | return false; |
| 193 | } |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 194 | // True - active |
Josh D. King | 697474c | 2017-03-02 11:15:55 -0600 | [diff] [blame] | 195 | return true; |
Josh D. King | 697474c | 2017-03-02 11:15:55 -0600 | [diff] [blame] | 196 | } |
| 197 | |
Patrick Williams | 8f8ba39 | 2017-05-05 15:47:39 -0500 | [diff] [blame] | 198 | int Chassis::sysStateChange(sdbusplus::message::message& msg) |
Andrew Geissler | 0029a5d | 2017-01-24 14:48:35 -0600 | [diff] [blame] | 199 | { |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 200 | uint32_t newStateID{}; |
Andrew Geissler | 0029a5d | 2017-01-24 14:48:35 -0600 | [diff] [blame] | 201 | sdbusplus::message::object_path newStateObjPath; |
| 202 | std::string newStateUnit{}; |
| 203 | std::string newStateResult{}; |
| 204 | |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 205 | // Read the msg and populate each variable |
William A. Kennington III | 09568ff | 2018-05-11 00:03:12 -0700 | [diff] [blame] | 206 | try |
| 207 | { |
| 208 | msg.read(newStateID, newStateObjPath, newStateUnit, newStateResult); |
| 209 | } |
| 210 | catch (const SdBusError& e) |
| 211 | { |
| 212 | log<level::ERR>("Error in state change - bad encoding", |
| 213 | entry("ERROR=%s", e.what()), |
| 214 | entry("REPLY_SIG=%s", msg.get_signature())); |
| 215 | return 0; |
| 216 | } |
Andrew Geissler | 0029a5d | 2017-01-24 14:48:35 -0600 | [diff] [blame] | 217 | |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 218 | if ((newStateUnit == CHASSIS_STATE_POWEROFF_TGT) && |
| 219 | (newStateResult == "done") && (!stateActive(CHASSIS_STATE_POWERON_TGT))) |
Andrew Geissler | 0029a5d | 2017-01-24 14:48:35 -0600 | [diff] [blame] | 220 | { |
Andrew Jeffery | 55b983e | 2017-04-19 11:11:26 +0930 | [diff] [blame] | 221 | log<level::INFO>("Received signal that power OFF is complete"); |
Andrew Geissler | 0029a5d | 2017-01-24 14:48:35 -0600 | [diff] [blame] | 222 | this->currentPowerState(server::Chassis::PowerState::Off); |
| 223 | } |
Andrew Geissler | 58a1801 | 2018-01-19 19:36:05 -0800 | [diff] [blame] | 224 | else if ((newStateUnit == CHASSIS_STATE_POWERON_TGT) && |
| 225 | (newStateResult == "done") && |
| 226 | (stateActive(CHASSIS_STATE_POWERON_TGT))) |
| 227 | { |
| 228 | log<level::INFO>("Received signal that power ON is complete"); |
| 229 | this->currentPowerState(server::Chassis::PowerState::On); |
| 230 | } |
Andrew Geissler | 0029a5d | 2017-01-24 14:48:35 -0600 | [diff] [blame] | 231 | |
| 232 | return 0; |
| 233 | } |
| 234 | |
Andrew Geissler | a90a31a | 2016-12-13 16:16:28 -0600 | [diff] [blame] | 235 | Chassis::Transition Chassis::requestedPowerTransition(Transition value) |
| 236 | { |
| 237 | |
| 238 | log<level::INFO>("Change to Chassis Requested Power State", |
| 239 | entry("CHASSIS_REQUESTED_POWER_STATE=%s", |
| 240 | convertForMessage(value).c_str())); |
Andrew Geissler | ce80f24 | 2017-01-24 13:25:33 -0600 | [diff] [blame] | 241 | executeTransition(value); |
Andrew Geissler | a90a31a | 2016-12-13 16:16:28 -0600 | [diff] [blame] | 242 | return server::Chassis::requestedPowerTransition(value); |
| 243 | } |
| 244 | |
| 245 | Chassis::PowerState Chassis::currentPowerState(PowerState value) |
| 246 | { |
Nagaraju Goruganti | cb781fe | 2018-04-06 13:41:01 -0500 | [diff] [blame] | 247 | PowerState chassisPowerState; |
Andrew Geissler | a90a31a | 2016-12-13 16:16:28 -0600 | [diff] [blame] | 248 | log<level::INFO>("Change to Chassis Power State", |
| 249 | entry("CHASSIS_CURRENT_POWER_STATE=%s", |
| 250 | convertForMessage(value).c_str())); |
Nagaraju Goruganti | cb781fe | 2018-04-06 13:41:01 -0500 | [diff] [blame] | 251 | |
| 252 | chassisPowerState = server::Chassis::currentPowerState(value); |
| 253 | if (chassisPowerState == PowerState::On) |
| 254 | { |
| 255 | timer->state(timer::ON); |
| 256 | } |
| 257 | else |
| 258 | { |
| 259 | timer->state(timer::OFF); |
| 260 | } |
| 261 | return chassisPowerState; |
| 262 | } |
| 263 | |
| 264 | uint32_t Chassis::pOHCounter(uint32_t value) |
| 265 | { |
| 266 | if (value != pOHCounter()) |
| 267 | { |
| 268 | ChassisInherit::pOHCounter(value); |
Matt Spinler | 8195784 | 2018-07-11 10:37:12 -0500 | [diff] [blame^] | 269 | serializePOH(); |
Nagaraju Goruganti | cb781fe | 2018-04-06 13:41:01 -0500 | [diff] [blame] | 270 | } |
| 271 | return pOHCounter(); |
| 272 | } |
| 273 | |
| 274 | void Chassis::restorePOHCounter() |
| 275 | { |
| 276 | uint32_t counter; |
Matt Spinler | 8195784 | 2018-07-11 10:37:12 -0500 | [diff] [blame^] | 277 | if (!deserializePOH(POH_COUNTER_PERSIST_PATH, counter)) |
Nagaraju Goruganti | cb781fe | 2018-04-06 13:41:01 -0500 | [diff] [blame] | 278 | { |
| 279 | // set to default value |
| 280 | pOHCounter(0); |
| 281 | } |
| 282 | else |
| 283 | { |
| 284 | pOHCounter(counter); |
| 285 | } |
| 286 | } |
| 287 | |
Matt Spinler | 8195784 | 2018-07-11 10:37:12 -0500 | [diff] [blame^] | 288 | fs::path Chassis::serializePOH(const fs::path& path) |
Nagaraju Goruganti | cb781fe | 2018-04-06 13:41:01 -0500 | [diff] [blame] | 289 | { |
| 290 | std::ofstream os(path.c_str(), std::ios::binary); |
| 291 | cereal::JSONOutputArchive oarchive(os); |
| 292 | oarchive(pOHCounter()); |
| 293 | return path; |
| 294 | } |
| 295 | |
Matt Spinler | 8195784 | 2018-07-11 10:37:12 -0500 | [diff] [blame^] | 296 | bool Chassis::deserializePOH(const fs::path& path, uint32_t& pOHCounter) |
Nagaraju Goruganti | cb781fe | 2018-04-06 13:41:01 -0500 | [diff] [blame] | 297 | { |
| 298 | try |
| 299 | { |
| 300 | if (fs::exists(path)) |
| 301 | { |
| 302 | std::ifstream is(path.c_str(), std::ios::in | std::ios::binary); |
| 303 | cereal::JSONInputArchive iarchive(is); |
| 304 | iarchive(pOHCounter); |
| 305 | return true; |
| 306 | } |
| 307 | return false; |
| 308 | } |
| 309 | catch (cereal::Exception& e) |
| 310 | { |
| 311 | log<level::ERR>(e.what()); |
| 312 | fs::remove(path); |
| 313 | return false; |
| 314 | } |
| 315 | catch (const fs::filesystem_error& e) |
| 316 | { |
| 317 | return false; |
| 318 | } |
| 319 | |
| 320 | return false; |
| 321 | } |
| 322 | |
| 323 | void Chassis::startPOHCounter() |
| 324 | { |
| 325 | using namespace std::chrono_literals; |
| 326 | using namespace phosphor::logging; |
| 327 | using namespace sdbusplus::xyz::openbmc_project::Common::Error; |
| 328 | |
| 329 | auto dir = fs::path(POH_COUNTER_PERSIST_PATH).parent_path(); |
| 330 | fs::create_directories(dir); |
| 331 | |
| 332 | sd_event* event = nullptr; |
| 333 | auto r = sd_event_default(&event); |
| 334 | if (r < 0) |
| 335 | { |
| 336 | log<level::ERR>("Error creating a default sd_event handler"); |
| 337 | throw; |
| 338 | } |
| 339 | |
| 340 | phosphor::state::manager::EventPtr eventP{event}; |
| 341 | event = nullptr; |
| 342 | |
| 343 | auto callback = [&]() { |
| 344 | if (ChassisInherit::currentPowerState() == PowerState::On) |
| 345 | { |
| 346 | pOHCounter(pOHCounter() + 1); |
| 347 | } |
| 348 | }; |
| 349 | |
| 350 | try |
| 351 | { |
| 352 | timer = std::make_unique<phosphor::state::manager::Timer>( |
| 353 | eventP, callback, std::chrono::seconds(POH::hour), |
| 354 | phosphor::state::manager::timer::ON); |
| 355 | bus.attach_event(eventP.get(), SD_EVENT_PRIORITY_NORMAL); |
| 356 | r = sd_event_loop(eventP.get()); |
| 357 | if (r < 0) |
| 358 | { |
| 359 | log<level::ERR>("Error occurred during the sd_event_loop", |
| 360 | entry("RC=%d", r)); |
| 361 | elog<InternalFailure>(); |
| 362 | } |
| 363 | } |
| 364 | catch (InternalFailure& e) |
| 365 | { |
| 366 | phosphor::logging::commit<InternalFailure>(); |
| 367 | } |
Andrew Geissler | a90a31a | 2016-12-13 16:16:28 -0600 | [diff] [blame] | 368 | } |
| 369 | |
| 370 | } // namespace manager |
| 371 | } // namespace state |
| 372 | } // namepsace phosphor |