Make dump path dbus entry
Some applications need to offload the dump in
different ways, for example, do DMA transfer of the dump to
the host memory, such applications need the path and name
of the file to read from the BMC storage. Implement
/xyz/openbmc_project/Common/FilePath to store the
dump path.
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
Change-Id: If398940b655b4d90688273f0c76a20d4ead61992
diff --git a/bmc_dump_entry.cpp b/bmc_dump_entry.cpp
index 6bdb761..188d262 100644
--- a/bmc_dump_entry.cpp
+++ b/bmc_dump_entry.cpp
@@ -20,13 +20,15 @@
// Delete Dump file from Permanent location
try
{
- std::filesystem::remove_all(file.parent_path());
+ std::filesystem::remove_all(
+ std::filesystem::path(path()).parent_path());
}
catch (const std::filesystem::filesystem_error& e)
{
// Log Error message and continue
log<level::ERR>(
- fmt::format("Failed to delete dump file, errormsg({})", e.what())
+ fmt::format("Failed to delete dump file({}), errormsg({})", path(),
+ e.what())
.c_str());
}
@@ -36,7 +38,7 @@
void Entry::initiateOffload(std::string uri)
{
- phosphor::dump::offload::requestOffload(file, id, uri);
+ phosphor::dump::offload::requestOffload(path(), id, uri);
offloaded(true);
}