Ben Tyner | b797b3e | 2020-06-29 10:12:05 -0500 | [diff] [blame] | 1 | #include <attn/attn_handler.hpp> |
| 2 | #include <attn/attn_logging.hpp> |
| 3 | #include <attn/ti_handler.hpp> |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 4 | #include <sdbusplus/bus.hpp> |
Ben Tyner | ff17f96 | 2020-09-23 08:21:19 -0500 | [diff] [blame] | 5 | #include <sdbusplus/exception.hpp> |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 6 | |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 7 | #include <iomanip> |
| 8 | #include <iostream> |
| 9 | |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 10 | namespace attn |
| 11 | { |
| 12 | |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 13 | /** |
| 14 | * @brief Determine if this is a HB or PHYP TI event |
| 15 | * |
| 16 | * Use the TI info data area to determine if this is either a HB or a PHYP |
| 17 | * TI event then handle the event. |
| 18 | * |
| 19 | * @param i_tiDataArea pointer to the TI infor data |
| 20 | */ |
Ben Tyner | 792f32f | 2020-06-02 08:50:47 -0500 | [diff] [blame] | 21 | int tiHandler(TiDataArea* i_tiDataArea) |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 22 | { |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 23 | int rc = RC_SUCCESS; |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 24 | |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 25 | // check TI data area if it is available |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 26 | if (nullptr != i_tiDataArea) |
Ben Tyner | 792f32f | 2020-06-02 08:50:47 -0500 | [diff] [blame] | 27 | { |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 28 | // HB v. PHYP TI logic: Only hosboot will fill in hbTerminateType |
| 29 | // and it will be non-zero. Only hostboot will fill out source and it |
| 30 | // it will be non-zero. Only PHYP will fill in srcFormat and it will |
| 31 | // be non-zero. |
| 32 | // source and only PHYP will fill in srcFormat. |
| 33 | if ((0 == i_tiDataArea->hbTerminateType) && |
| 34 | (0 == i_tiDataArea->source) && (0 != i_tiDataArea->srcFormat)) |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 35 | { |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 36 | handlePhypTi(i_tiDataArea); |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 37 | } |
| 38 | else |
| 39 | { |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 40 | handleHbTi(i_tiDataArea); |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 41 | } |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 42 | } |
| 43 | else |
| 44 | { |
| 45 | // TI data was not available, assume PHYP TI for now. When a host state |
| 46 | // management interface becomes availabe we may be able to make a more |
| 47 | // informed decision here. |
| 48 | handlePhypTi(i_tiDataArea); |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 49 | } |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 50 | |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 51 | return rc; |
| 52 | } |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 53 | |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 54 | /** |
| 55 | * @brief Transition the host state |
| 56 | * |
| 57 | * We will transition the host state by starting the appropriate dbus target. |
| 58 | * |
| 59 | * @param i_target the dbus target to start |
| 60 | */ |
| 61 | void transitionHost(const char* i_target) |
| 62 | { |
| 63 | // We will be transitioning host by starting appropriate dbus target |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 64 | auto bus = sdbusplus::bus::new_system(); |
| 65 | auto method = bus.new_method_call( |
| 66 | "org.freedesktop.systemd1", "/org/freedesktop/systemd1", |
| 67 | "org.freedesktop.systemd1.Manager", "StartUnit"); |
| 68 | |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 69 | method.append(i_target); // target unit to start |
| 70 | method.append("replace"); // mode = replace conflicting queued jobs |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 71 | |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 72 | trace<level::INFO>(i_target); |
| 73 | |
| 74 | bus.call_noreply(method); // start the service |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * @brief Handle a PHYP terminate immediate special attention |
| 79 | * |
| 80 | * The TI info data area will contain information pertaining to the TI |
| 81 | * condition. We will wither quiesce the host or initiate a MPIPL depending |
| 82 | * depending on the auto reboot configuration. We will also create a PEL which |
| 83 | * will contain the TI info data and FFDC data captured in the system journal. |
| 84 | * |
| 85 | * @param i_tiDataArea pointer to TI information filled in by hostboot |
| 86 | */ |
| 87 | void handlePhypTi(TiDataArea* i_tiDataArea) |
| 88 | { |
| 89 | trace<level::INFO>("PHYP TI"); |
| 90 | |
| 91 | if (autoRebootEnabled()) |
| 92 | { |
| 93 | // If autoreboot is enabled we will start diagnostic mode target |
| 94 | // which will ultimately mpipl the host. |
| 95 | transitionHost("obmc-host-diagnostic-mode@0.target"); |
Ben Tyner | 792f32f | 2020-06-02 08:50:47 -0500 | [diff] [blame] | 96 | } |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 97 | else |
| 98 | { |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 99 | // If autoreboot is disabled we will quiesce the host |
| 100 | transitionHost("obmc-host-quiesce@0.target"); |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 101 | } |
Ben Tyner | 792f32f | 2020-06-02 08:50:47 -0500 | [diff] [blame] | 102 | |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 103 | // gather additional data for PEL |
| 104 | std::map<std::string, std::string> tiAdditionalData; |
Ben Tyner | e4f5dbe | 2020-10-19 07:19:33 -0500 | [diff] [blame] | 105 | |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 106 | if (nullptr != i_tiDataArea) |
| 107 | { |
| 108 | parsePhypOpalTiInfo(tiAdditionalData, i_tiDataArea); |
| 109 | parseRawTiInfo(tiAdditionalData, i_tiDataArea); |
| 110 | } |
| 111 | |
| 112 | eventTerminate(tiAdditionalData); // generate PEL |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * @brief Handle a hostboot terminate immediate special attention |
| 117 | * |
| 118 | * The TI info data area will contain information pertaining to the TI |
| 119 | * condition. The course of action to take regarding the host state will |
| 120 | * depend on the contents of the TI info data area. We will also create a |
| 121 | * PEL containing the TI info data and FFDC data captured in the system |
| 122 | * journal. |
| 123 | * |
| 124 | * @param i_tiDataArea pointer to TI information filled in by hostboot |
| 125 | */ |
| 126 | void handleHbTi(TiDataArea* i_tiDataArea) |
| 127 | { |
| 128 | trace<level::INFO>("HB TI"); |
| 129 | |
| 130 | bool hbDumpRequested = true; // HB dump is common case |
| 131 | bool generatePel = true; // assume PEL will be created |
| 132 | bool terminateHost = true; // transition host state |
| 133 | |
| 134 | // handle specific hostboot reason codes |
| 135 | if (nullptr != i_tiDataArea) |
| 136 | { |
| 137 | std::stringstream ss; |
| 138 | ss << std::hex << std::showbase; |
| 139 | |
| 140 | switch (i_tiDataArea->hbTerminateType) |
| 141 | { |
| 142 | case TI_WITH_PLID: |
| 143 | case TI_WITH_EID: |
| 144 | ss << "TI with PLID/EID: " << be32toh(i_tiDataArea->asciiData1); |
| 145 | trace<level::INFO>(ss.str().c_str()); |
| 146 | if (0 == i_tiDataArea->hbDumpFlag) |
| 147 | { |
| 148 | hbDumpRequested = false; // no HB dump requested |
| 149 | } |
| 150 | break; |
| 151 | case TI_WITH_SRC: |
| 152 | // SRC is byte 2 and 3 of 4 byte srcWord12HbWord0 |
| 153 | uint16_t hbSrc = be32toh(i_tiDataArea->srcWord12HbWord0); |
| 154 | |
| 155 | // trace some info |
| 156 | ss << "TI with SRC: " << (int)hbSrc; |
| 157 | trace<level::INFO>(ss.str().c_str()); |
| 158 | ss.str(std::string()); // clear stream |
| 159 | |
| 160 | switch (hbSrc) |
| 161 | { |
| 162 | case HB_SRC_SHUTDOWN_REQUEST: |
| 163 | trace<level::INFO>("shutdown request"); |
| 164 | generatePel = false; |
| 165 | break; |
| 166 | case HB_SRC_KEY_TRANSITION: |
| 167 | trace<level::INFO>("key transition"); |
| 168 | terminateHost = false; |
| 169 | break; |
| 170 | case HB_SRC_INSUFFICIENT_HW: |
| 171 | trace<level::INFO>("insufficient hardware"); |
| 172 | break; |
| 173 | case HB_SRC_TPM_FAIL: |
| 174 | trace<level::INFO>("TPM fail"); |
| 175 | break; |
| 176 | case HB_SRC_ROM_VERIFY: |
| 177 | trace<level::INFO>("ROM verify"); |
| 178 | break; |
| 179 | case HB_SRC_EXT_MISMATCH: |
| 180 | trace<level::INFO>("EXT mismatch"); |
| 181 | break; |
| 182 | case HB_SRC_ECC_UE: |
| 183 | trace<level::INFO>("ECC UE"); |
| 184 | break; |
| 185 | case HB_SRC_UNSUPPORTED_MODE: |
| 186 | trace<level::INFO>("unsupported mode"); |
| 187 | break; |
| 188 | case HB_SRC_UNSUPPORTED_SFCRANGE: |
| 189 | trace<level::INFO>("unsupported SFC range"); |
| 190 | break; |
| 191 | case HB_SRC_PARTITION_TABLE: |
| 192 | trace<level::INFO>("partition table invalid"); |
| 193 | break; |
| 194 | case HB_SRC_UNSUPPORTED_HARDWARE: |
| 195 | trace<level::INFO>("unsupported hardware"); |
| 196 | break; |
| 197 | case HB_SRC_PNOR_CORRUPTION: |
| 198 | trace<level::INFO>("PNOR corruption"); |
| 199 | break; |
| 200 | default: |
| 201 | trace<level::INFO>("reason: other"); |
| 202 | } |
| 203 | |
| 204 | break; |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | if (true == terminateHost) |
| 209 | { |
| 210 | // if hostboot dump is requested initiate dump |
| 211 | if (hbDumpRequested) |
| 212 | { |
| 213 | // Until HB dump support available just quiesce the host - once |
| 214 | // dump support is available the dump component will transition |
| 215 | // (ipl/halt) the host. |
| 216 | transitionHost("obmc-host-quiesce@0.target"); |
| 217 | } |
| 218 | else |
| 219 | { |
| 220 | // Quiese the host - when the host is quiesced it will either |
| 221 | // "halt" or IPL depending on autoreboot setting. |
| 222 | transitionHost("obmc-host-quiesce@0.target"); |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | // gather additional data for PEL |
| 227 | std::map<std::string, std::string> tiAdditionalData; |
| 228 | |
| 229 | if (nullptr != i_tiDataArea) |
| 230 | { |
| 231 | parseHbTiInfo(tiAdditionalData, i_tiDataArea); |
| 232 | parseRawTiInfo(tiAdditionalData, i_tiDataArea); |
| 233 | } |
| 234 | |
| 235 | if (true == generatePel) |
| 236 | { |
| 237 | eventTerminate(tiAdditionalData); // generate PEL |
| 238 | } |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 239 | } |
| 240 | |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 241 | /** @brief Parse the TI info data area into map as raw 32-bit fields */ |
| 242 | void parseRawTiInfo(std::map<std::string, std::string>& i_map, |
| 243 | TiDataArea* i_buffer) |
| 244 | { |
Ben Tyner | 1c4b02e | 2020-11-09 14:00:29 -0600 | [diff] [blame] | 245 | if (nullptr == i_buffer) |
| 246 | { |
| 247 | return; |
| 248 | } |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 249 | |
| 250 | uint32_t* tiDataArea = (uint32_t*)i_buffer; |
| 251 | std::stringstream ss; |
| 252 | |
| 253 | ss << std::hex << std::setfill('0'); |
| 254 | ss << "raw:"; |
| 255 | while (tiDataArea <= (uint32_t*)((char*)i_buffer + sizeof(TiDataArea))) |
| 256 | { |
| 257 | ss << std::setw(8) << std::endl << be32toh(*tiDataArea); |
| 258 | tiDataArea++; |
| 259 | } |
| 260 | |
| 261 | std::string key, value; |
| 262 | char delim = ':'; |
| 263 | |
| 264 | while (std::getline(ss, key, delim)) |
| 265 | { |
| 266 | std::getline(ss, value, delim); |
| 267 | i_map[key] = value; |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | /** @brief Parse the TI info data area into map as PHYP/OPAL data */ |
| 272 | void parsePhypOpalTiInfo(std::map<std::string, std::string>& i_map, |
| 273 | TiDataArea* i_tiDataArea) |
| 274 | { |
Ben Tyner | 1c4b02e | 2020-11-09 14:00:29 -0600 | [diff] [blame] | 275 | if (nullptr == i_tiDataArea) |
| 276 | { |
| 277 | return; |
| 278 | } |
| 279 | |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 280 | std::stringstream ss; |
| 281 | |
| 282 | ss << std::hex << std::showbase; |
| 283 | ss << "0x00 TI Area Valid:" << (int)i_tiDataArea->tiAreaValid << ":"; |
| 284 | ss << "0x01 Command:" << (int)i_tiDataArea->command << ":"; |
| 285 | ss << "0x02 Num. Data Bytes:" << be16toh(i_tiDataArea->numDataBytes) << ":"; |
| 286 | ss << "0x04 Reserved:" << (int)i_tiDataArea->reserved1 << ":"; |
| 287 | ss << "0x06 HWDump Type:" << be16toh(i_tiDataArea->hardwareDumpType) << ":"; |
| 288 | ss << "0x08 SRC Format:" << (int)i_tiDataArea->srcFormat << ":"; |
| 289 | ss << "0x09 SRC Flags:" << (int)i_tiDataArea->srcFlags << ":"; |
| 290 | ss << "0x0a Num. ASCII Words:" << (int)i_tiDataArea->numAsciiWords << ":"; |
| 291 | ss << "0x0b Num. Hex Words:" << (int)i_tiDataArea->numHexWords << ":"; |
| 292 | ss << "0x0e Length of SRC:" << be16toh(i_tiDataArea->lenSrc) << ":"; |
| 293 | ss << "0x10 SRC Word 12:" << be32toh(i_tiDataArea->srcWord12HbWord0) << ":"; |
| 294 | ss << "0x14 SRC Word 13:" << be32toh(i_tiDataArea->srcWord13HbWord2) << ":"; |
| 295 | ss << "0x18 SRC Word 14:" << be32toh(i_tiDataArea->srcWord14HbWord3) << ":"; |
| 296 | ss << "0x1c SRC Word 15:" << be32toh(i_tiDataArea->srcWord15HbWord4) << ":"; |
| 297 | ss << "0x20 SRC Word 16:" << be32toh(i_tiDataArea->srcWord16HbWord5) << ":"; |
| 298 | ss << "0x24 SRC Word 17:" << be32toh(i_tiDataArea->srcWord17HbWord6) << ":"; |
| 299 | ss << "0x28 SRC Word 18:" << be32toh(i_tiDataArea->srcWord18HbWord7) << ":"; |
| 300 | ss << "0x2c SRC Word 19:" << be32toh(i_tiDataArea->srcWord19HbWord8) << ":"; |
| 301 | ss << "0x30 ASCII Data:" << be32toh(i_tiDataArea->asciiData0) << ":"; |
| 302 | ss << "0x34 ASCII Data:" << be32toh(i_tiDataArea->asciiData1) << ":"; |
| 303 | ss << "0x38 ASCII Data:" << be32toh(i_tiDataArea->asciiData2) << ":"; |
| 304 | ss << "0x3c ASCII Data:" << be32toh(i_tiDataArea->asciiData3) << ":"; |
| 305 | ss << "0x40 ASCII Data:" << be32toh(i_tiDataArea->asciiData4) << ":"; |
| 306 | ss << "0x44 ASCII Data:" << be32toh(i_tiDataArea->asciiData5) << ":"; |
| 307 | ss << "0x48 ASCII Data:" << be32toh(i_tiDataArea->asciiData6) << ":"; |
| 308 | ss << "0x4c ASCII Data:" << be32toh(i_tiDataArea->asciiData7) << ":"; |
| 309 | ss << "0x50 Location:" << (int)i_tiDataArea->location << ":"; |
| 310 | ss << "0x51 Code Sections:" << (int)i_tiDataArea->codeSection << ":"; |
| 311 | ss << "0x52 Additional Size:" << (int)i_tiDataArea->additionalSize << ":"; |
| 312 | ss << "0x53 Additional Data:" << (int)i_tiDataArea->andData; |
| 313 | |
| 314 | std::string key, value; |
| 315 | char delim = ':'; |
| 316 | |
| 317 | while (std::getline(ss, key, delim)) |
| 318 | { |
| 319 | std::getline(ss, value, delim); |
| 320 | i_map[key] = value; |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | /** @brief Parse the TI info data area into map as hostboot data */ |
| 325 | void parseHbTiInfo(std::map<std::string, std::string>& i_map, |
| 326 | TiDataArea* i_tiDataArea) |
| 327 | { |
Ben Tyner | 1c4b02e | 2020-11-09 14:00:29 -0600 | [diff] [blame] | 328 | if (nullptr == i_tiDataArea) |
| 329 | { |
| 330 | return; |
| 331 | } |
| 332 | |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 333 | std::stringstream ss; |
| 334 | |
| 335 | ss << std::hex << std::showbase; |
| 336 | ss << "0x00 TI Area Valid:" << (int)i_tiDataArea->tiAreaValid << ":"; |
| 337 | ss << "0x04 Reserved:" << (int)i_tiDataArea->reserved1 << ":"; |
| 338 | ss << "0x05 HB_Term. Type:" << (int)i_tiDataArea->hbTerminateType << ":"; |
| 339 | ss << "0x0c HB Dump Flag:" << (int)i_tiDataArea->hbDumpFlag << ":"; |
| 340 | ss << "0x0d Source:" << (int)i_tiDataArea->source << ":"; |
| 341 | ss << "0x10 HB Word 0:" << be32toh(i_tiDataArea->srcWord12HbWord0) << ":"; |
| 342 | ss << "0x14 HB Word 2:" << be32toh(i_tiDataArea->srcWord13HbWord2) << ":"; |
| 343 | ss << "0x18 HB Word 3:" << be32toh(i_tiDataArea->srcWord14HbWord3) << ":"; |
| 344 | ss << "0x1c HB Word 4:" << be32toh(i_tiDataArea->srcWord15HbWord4) << ":"; |
| 345 | ss << "0x20 HB Word 5:" << be32toh(i_tiDataArea->srcWord16HbWord5) << ":"; |
| 346 | ss << "0x24 HB Word 6:" << be32toh(i_tiDataArea->srcWord17HbWord6) << ":"; |
| 347 | ss << "0x28 HB Word 7:" << be32toh(i_tiDataArea->srcWord18HbWord7) << ":"; |
| 348 | ss << "0x2c HB Word 8:" << be32toh(i_tiDataArea->srcWord19HbWord8) << ":"; |
| 349 | ss << "0x30 error_data:" << be32toh(i_tiDataArea->asciiData0) << ":"; |
| 350 | ss << "0x34 EID:" << be32toh(i_tiDataArea->asciiData1); |
| 351 | |
| 352 | std::string key, value; |
| 353 | char delim = ':'; |
| 354 | |
| 355 | while (std::getline(ss, key, delim)) |
| 356 | { |
| 357 | std::getline(ss, value, delim); |
| 358 | i_map[key] = value; |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | /** @brief Read state of autoreboot propertyi via dbus */ |
Ben Tyner | ff17f96 | 2020-09-23 08:21:19 -0500 | [diff] [blame] | 363 | bool autoRebootEnabled() |
| 364 | { |
| 365 | // Use dbus get-property interface to read the autoreboot property |
| 366 | auto bus = sdbusplus::bus::new_system(); |
| 367 | auto method = |
| 368 | bus.new_method_call("xyz.openbmc_project.Settings", |
| 369 | "/xyz/openbmc_project/control/host0/auto_reboot", |
| 370 | "org.freedesktop.DBus.Properties", "Get"); |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 371 | |
Ben Tyner | ff17f96 | 2020-09-23 08:21:19 -0500 | [diff] [blame] | 372 | method.append("xyz.openbmc_project.Control.Boot.RebootPolicy", |
| 373 | "AutoReboot"); |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 374 | |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 375 | bool autoReboot = false; // assume autoreboot attribute not available |
| 376 | |
Ben Tyner | ff17f96 | 2020-09-23 08:21:19 -0500 | [diff] [blame] | 377 | try |
| 378 | { |
| 379 | auto reply = bus.call(method); |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 380 | |
Ben Tyner | ff17f96 | 2020-09-23 08:21:19 -0500 | [diff] [blame] | 381 | std::variant<bool> result; |
| 382 | reply.read(result); |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 383 | autoReboot = std::get<bool>(result); |
Ben Tyner | ff17f96 | 2020-09-23 08:21:19 -0500 | [diff] [blame] | 384 | } |
| 385 | catch (const sdbusplus::exception::SdBusError& ec) |
| 386 | { |
Ben Tyner | ff17f96 | 2020-09-23 08:21:19 -0500 | [diff] [blame] | 387 | std::string traceMessage = |
| 388 | "Error in AutoReboot Get: " + std::string(ec.what()); |
| 389 | trace<level::INFO>(traceMessage.c_str()); |
Ben Tyner | ff17f96 | 2020-09-23 08:21:19 -0500 | [diff] [blame] | 390 | } |
Ben Tyner | 8c5e4f4 | 2020-10-28 11:11:55 -0500 | [diff] [blame] | 391 | |
| 392 | return autoReboot; |
Ben Tyner | ff17f96 | 2020-09-23 08:21:19 -0500 | [diff] [blame] | 393 | } |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 394 | |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 395 | } // namespace attn |