Dhruvaraj Subhashchandran | 4a98e8f | 2020-01-29 07:11:08 -0600 | [diff] [blame] | 1 | #include "bmc_dump_entry.hpp" |
| 2 | |
| 3 | #include "dump_manager.hpp" |
Dhruvaraj Subhashchandran | 580d91d | 2020-04-22 12:29:18 -0500 | [diff] [blame] | 4 | #include "dump_offload.hpp" |
Dhruvaraj Subhashchandran | 4a98e8f | 2020-01-29 07:11:08 -0600 | [diff] [blame] | 5 | |
Dhruvaraj Subhashchandran | d1f670f | 2023-06-05 22:19:25 -0500 | [diff] [blame] | 6 | #include <phosphor-logging/lg2.hpp> |
Dhruvaraj Subhashchandran | 4a98e8f | 2020-01-29 07:11:08 -0600 | [diff] [blame] | 7 | |
| 8 | namespace phosphor |
| 9 | { |
| 10 | namespace dump |
| 11 | { |
| 12 | namespace bmc |
| 13 | { |
Dhruvaraj Subhashchandran | 4a98e8f | 2020-01-29 07:11:08 -0600 | [diff] [blame] | 14 | |
| 15 | void Entry::delete_() |
| 16 | { |
| 17 | // Delete Dump file from Permanent location |
| 18 | try |
| 19 | { |
Jayanth Othayoth | 3fc6df4 | 2021-04-08 03:45:24 -0500 | [diff] [blame] | 20 | std::filesystem::remove_all(file.parent_path()); |
Dhruvaraj Subhashchandran | 4a98e8f | 2020-01-29 07:11:08 -0600 | [diff] [blame] | 21 | } |
Patrick Williams | 9d2d722 | 2021-10-06 12:44:44 -0500 | [diff] [blame] | 22 | catch (const std::filesystem::filesystem_error& e) |
Dhruvaraj Subhashchandran | 4a98e8f | 2020-01-29 07:11:08 -0600 | [diff] [blame] | 23 | { |
| 24 | // Log Error message and continue |
Dhruvaraj Subhashchandran | d1f670f | 2023-06-05 22:19:25 -0500 | [diff] [blame] | 25 | lg2::error("Failed to delete dump file, errormsg: {ERROR}", "ERROR", e); |
Dhruvaraj Subhashchandran | 4a98e8f | 2020-01-29 07:11:08 -0600 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | // Remove Dump entry D-bus object |
| 29 | phosphor::dump::Entry::delete_(); |
| 30 | } |
| 31 | |
Dhruvaraj Subhashchandran | 580d91d | 2020-04-22 12:29:18 -0500 | [diff] [blame] | 32 | void Entry::initiateOffload(std::string uri) |
| 33 | { |
| 34 | phosphor::dump::offload::requestOffload(file, id, uri); |
| 35 | offloaded(true); |
| 36 | } |
| 37 | |
Dhruvaraj Subhashchandran | 4a98e8f | 2020-01-29 07:11:08 -0600 | [diff] [blame] | 38 | } // namespace bmc |
| 39 | } // namespace dump |
| 40 | } // namespace phosphor |