secure-boot: optional param for data on error create
For the secure-boot function, it will be valuable to store the values
which were read to the error log. This will make it easy to determine
which value(s) are incorrect and causing the error log.
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: Icfabae558fe4d128bae55e114191b15d6c2d0ee2
diff --git a/utils.cpp b/utils.cpp
index d925d4c..18afd90 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -132,13 +132,13 @@
void createError(
sdbusplus::bus::bus& bus, const std::string& errorMsg,
- sdbusplus::xyz::openbmc_project::Logging::server::Entry::Level errLevel)
+ sdbusplus::xyz::openbmc_project::Logging::server::Entry::Level errLevel,
+ std::map<std::string, std::string> additionalData)
{
try
{
- // Create interface requires something for additionalData
- std::map<std::string, std::string> additionalData;
+ // Always add the _PID on for some extra logging debug
additionalData.emplace("_PID", std::to_string(getpid()));
auto method = bus.new_method_call(
diff --git a/utils.hpp b/utils.hpp
index e016d4f..5e747b7 100644
--- a/utils.hpp
+++ b/utils.hpp
@@ -58,13 +58,15 @@
/** @brief Create an error log
*
- * @param[in] bus - The Dbus bus object
- * @param[in] errorMsg - The error message
- * @param[in] errLevel - The error level
+ * @param[in] bus - The Dbus bus object
+ * @param[in] errorMsg - The error message
+ * @param[in] errLevel - The error level
+ * parampin] additionalData - Optional extra data to add to the log
*/
void createError(
sdbusplus::bus::bus& bus, const std::string& errorMsg,
- sdbusplus::xyz::openbmc_project::Logging::server::Entry::Level errLevel);
+ sdbusplus::xyz::openbmc_project::Logging::server::Entry::Level errLevel,
+ std::map<std::string, std::string> additionalData = {});
/** @brief Call phosphor-dump-manager to create BMC user dump
*