host: Added support to delete system dump

To delete host system dump using pldm oem command "FileAck" with
dump file type and dump id which is present as source dump id (which
is got from pldm after created the host system dump) in system dump entry
dbus object and also, to use pldm oem command added support to indicate
delete host system dump support is not available for other host transport
consumer and for other oem vendors who are using pldm as host transport
to get host dump.

Also, changed existing commited error i.e internal failure into not allowed
for host system dump offload to avoid bmc dump creation in dump path.

Signed-off-by: Ramesh Iyyar <rameshi1@in.ibm.com>
Change-Id: Ib6be5b521fb3c5aa2926497bae0b03c1d9737161
diff --git a/dump-extensions/openpower-dumps/system_dump_entry.cpp b/dump-extensions/openpower-dumps/system_dump_entry.cpp
index 83723b4..eed76bd 100644
--- a/dump-extensions/openpower-dumps/system_dump_entry.cpp
+++ b/dump-extensions/openpower-dumps/system_dump_entry.cpp
@@ -1,5 +1,6 @@
 #include "system_dump_entry.hpp"
 
+#include "dump_utils.hpp"
 #include "host_transport_exts.hpp"
 
 namespace phosphor
@@ -15,6 +16,23 @@
     phosphor::dump::host::requestOffload(sourceDumpId());
 }
 
+void Entry::delete_()
+{
+    auto srcDumpID = sourceDumpId();
+
+    // Remove Dump entry D-bus object
+    phosphor::dump::Entry::delete_();
+
+    // Remove host system dump when host is up by using source dump id
+    // which is present in system dump entry dbus object as a property.
+    BootProgress bootProgressStatus = phosphor::dump::getBootProgress();
+    if ((bootProgressStatus == BootProgress::SystemInitComplete) ||
+        (bootProgressStatus == BootProgress::OSStart) ||
+        (bootProgressStatus == BootProgress::OSRunning))
+    {
+        phosphor::dump::host::requestDelete(srcDumpID);
+    }
+}
 } // namespace system
 } // namespace dump
 } // namespace phosphor