| Dhruvaraj Subhashchandran | 69e6152 | 2020-02-04 06:39:11 -0600 | [diff] [blame] | 1 | #include "system_dump_entry.hpp" | 
|  | 2 |  | 
| Ramesh Iyyar | 2279386 | 2020-12-04 04:03:03 -0600 | [diff] [blame] | 3 | #include "dump_utils.hpp" | 
| Ramesh Iyyar | 131994b | 2020-12-03 08:35:36 -0600 | [diff] [blame] | 4 | #include "host_transport_exts.hpp" | 
| Dhruvaraj Subhashchandran | 69e6152 | 2020-02-04 06:39:11 -0600 | [diff] [blame] | 5 |  | 
| Dhruvaraj Subhashchandran | 6a54d9a | 2020-12-17 22:24:37 -0600 | [diff] [blame] | 6 | #include <phosphor-logging/elog-errors.hpp> | 
|  | 7 | #include <xyz/openbmc_project/Common/error.hpp> | 
|  | 8 |  | 
| Dhruvaraj Subhashchandran | 341d683 | 2021-01-15 06:28:04 -0600 | [diff] [blame] | 9 | namespace openpower | 
| Dhruvaraj Subhashchandran | 69e6152 | 2020-02-04 06:39:11 -0600 | [diff] [blame] | 10 | { | 
|  | 11 | namespace dump | 
|  | 12 | { | 
|  | 13 | namespace system | 
|  | 14 | { | 
| Dhruvaraj Subhashchandran | 4c63ce5 | 2020-12-18 02:07:22 -0600 | [diff] [blame] | 15 | // TODO #ibm-openbmc/issues/2859 | 
|  | 16 | // Revisit host transport impelementation | 
|  | 17 | // This value is used to identify the dump in the transport layer to host, | 
|  | 18 | constexpr auto TRANSPORT_DUMP_TYPE_IDENTIFIER = 3; | 
| Dhruvaraj Subhashchandran | 6a54d9a | 2020-12-17 22:24:37 -0600 | [diff] [blame] | 19 | using namespace phosphor::logging; | 
| Dhruvaraj Subhashchandran | 69e6152 | 2020-02-04 06:39:11 -0600 | [diff] [blame] | 20 |  | 
|  | 21 | void Entry::initiateOffload(std::string uri) | 
|  | 22 | { | 
|  | 23 | phosphor::dump::Entry::initiateOffload(uri); | 
| Dhruvaraj Subhashchandran | 59642e2 | 2020-03-19 03:37:44 -0500 | [diff] [blame] | 24 | phosphor::dump::host::requestOffload(sourceDumpId()); | 
| Dhruvaraj Subhashchandran | 69e6152 | 2020-02-04 06:39:11 -0600 | [diff] [blame] | 25 | } | 
|  | 26 |  | 
| Ramesh Iyyar | 2279386 | 2020-12-04 04:03:03 -0600 | [diff] [blame] | 27 | void Entry::delete_() | 
|  | 28 | { | 
|  | 29 | auto srcDumpID = sourceDumpId(); | 
|  | 30 |  | 
|  | 31 | // Remove Dump entry D-bus object | 
|  | 32 | phosphor::dump::Entry::delete_(); | 
|  | 33 |  | 
|  | 34 | // Remove host system dump when host is up by using source dump id | 
|  | 35 | // which is present in system dump entry dbus object as a property. | 
| Dhruvaraj Subhashchandran | 6a54d9a | 2020-12-17 22:24:37 -0600 | [diff] [blame] | 36 | if (phosphor::dump::isHostRunning()) | 
| Ramesh Iyyar | 2279386 | 2020-12-04 04:03:03 -0600 | [diff] [blame] | 37 | { | 
| Dhruvaraj Subhashchandran | 4c63ce5 | 2020-12-18 02:07:22 -0600 | [diff] [blame] | 38 | phosphor::dump::host::requestDelete(srcDumpID, | 
|  | 39 | TRANSPORT_DUMP_TYPE_IDENTIFIER); | 
| Ramesh Iyyar | 2279386 | 2020-12-04 04:03:03 -0600 | [diff] [blame] | 40 | } | 
|  | 41 | } | 
| Dhruvaraj Subhashchandran | 69e6152 | 2020-02-04 06:39:11 -0600 | [diff] [blame] | 42 | } // namespace system | 
|  | 43 | } // namespace dump | 
| Dhruvaraj Subhashchandran | 341d683 | 2021-01-15 06:28:04 -0600 | [diff] [blame] | 44 | } // namespace openpower |