blob: 3d2e734213c543c011958050ea839f56710bbcc1 [file] [log] [blame]
Dhruvaraj Subhashchandran69e61522020-02-04 06:39:11 -06001#include "system_dump_entry.hpp"
2
Ramesh Iyyar22793862020-12-04 04:03:03 -06003#include "dump_utils.hpp"
Ramesh Iyyar131994b2020-12-03 08:35:36 -06004#include "host_transport_exts.hpp"
Dhruvaraj Subhashchandranad50d422022-01-18 05:54:02 -06005#include "op_dump_consts.hpp"
Dhruvaraj Subhashchandran69e61522020-02-04 06:39:11 -06006
Dhruvaraj Subhashchandran6a54d9a2020-12-17 22:24:37 -06007#include <phosphor-logging/elog-errors.hpp>
8#include <xyz/openbmc_project/Common/error.hpp>
9
Dhruvaraj Subhashchandran341d6832021-01-15 06:28:04 -060010namespace openpower
Dhruvaraj Subhashchandran69e61522020-02-04 06:39:11 -060011{
12namespace dump
13{
14namespace system
15{
Dhruvaraj Subhashchandran4c63ce52020-12-18 02:07:22 -060016// TODO #ibm-openbmc/issues/2859
17// Revisit host transport impelementation
18// This value is used to identify the dump in the transport layer to host,
19constexpr auto TRANSPORT_DUMP_TYPE_IDENTIFIER = 3;
Dhruvaraj Subhashchandran6a54d9a2020-12-17 22:24:37 -060020using namespace phosphor::logging;
Dhruvaraj Subhashchandran69e61522020-02-04 06:39:11 -060021
22void Entry::initiateOffload(std::string uri)
23{
24 phosphor::dump::Entry::initiateOffload(uri);
Dhruvaraj Subhashchandran59642e22020-03-19 03:37:44 -050025 phosphor::dump::host::requestOffload(sourceDumpId());
Dhruvaraj Subhashchandran69e61522020-02-04 06:39:11 -060026}
27
Ramesh Iyyar22793862020-12-04 04:03:03 -060028void Entry::delete_()
29{
30 auto srcDumpID = sourceDumpId();
31
32 // Remove Dump entry D-bus object
33 phosphor::dump::Entry::delete_();
34
35 // Remove host system dump when host is up by using source dump id
36 // which is present in system dump entry dbus object as a property.
Dhruvaraj Subhashchandranad50d422022-01-18 05:54:02 -060037 if ((phosphor::dump::isHostRunning()) && (srcDumpID != INVALID_SOURCE_ID))
Ramesh Iyyar22793862020-12-04 04:03:03 -060038 {
Dhruvaraj Subhashchandran4c63ce52020-12-18 02:07:22 -060039 phosphor::dump::host::requestDelete(srcDumpID,
40 TRANSPORT_DUMP_TYPE_IDENTIFIER);
Ramesh Iyyar22793862020-12-04 04:03:03 -060041 }
42}
Dhruvaraj Subhashchandran69e61522020-02-04 06:39:11 -060043} // namespace system
44} // namespace dump
Dhruvaraj Subhashchandran341d6832021-01-15 06:28:04 -060045} // namespace openpower