diff options
author | Matt Spinler <spinler@us.ibm.com> | 2018-05-01 15:20:55 -0500 |
---|---|---|
committer | Matt Spinler <spinler@us.ibm.com> | 2018-05-01 15:46:23 -0500 |
commit | 375ac9b9e575e97932b308dd4a1822dd538d511c (patch) | |
tree | a1562c4651c4c11bdbd1439426ff971eebc0e489 /elog_entry.hpp | |
parent | 1275bd13cc207167b489f661d10a7263b211bbcb (diff) | |
download | phosphor-logging-375ac9b9e575e97932b308dd4a1822dd538d511c.tar.gz phosphor-logging-375ac9b9e575e97932b308dd4a1822dd538d511c.zip |
Add the BMC code version to error logs
Add the xyz.openbmc_project.Software.Version interface to
the elog entries. This allows a user to know what BMC code
level was running when the error was created. The level is
persisted along with the other elog fields.
If this code is flashed on a system that was running older code,
and there were existing error logs, the version property will
be left empty in the restored log entries.
Older code is still able to restore logs created by this code
as the version property is at the end of the serialized data
and so is just ignored by Cereal.
Resolves openbmc/openbmc#3133
Tested: Check that new error logs have the code level, and that
restarting phosphor-log-manager preserves that property
on the existing logs. Various incantations of running
the older code with logs created by this code, and running
this code with logs created by older code.
Change-Id: I682aa3bf97c8352ce6dda05dfdf55d33173de891
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'elog_entry.hpp')
-rw-r--r-- | elog_entry.hpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/elog_entry.hpp b/elog_entry.hpp index 8dcc2a2..5ee8f5f 100644 --- a/elog_entry.hpp +++ b/elog_entry.hpp @@ -4,6 +4,7 @@ #include <sdbusplus/server/object.hpp> #include "xyz/openbmc_project/Logging/Entry/server.hpp" #include "xyz/openbmc_project/Object/Delete/server.hpp" +#include "xyz/openbmc_project/Software/Version/server.hpp" #include "org/openbmc/Associations/server.hpp" namespace phosphor @@ -14,7 +15,8 @@ namespace logging using EntryIfaces = sdbusplus::server::object::object< sdbusplus::xyz::openbmc_project::Logging::server::Entry, sdbusplus::xyz::openbmc_project::Object::server::Delete, - sdbusplus::org::openbmc::server::Associations>; + sdbusplus::org::openbmc::server::Associations, + sdbusplus::xyz::openbmc_project::Software::server::Version>; using AssociationList = std::vector<std::tuple<std::string, std::string, std::string>>; @@ -50,6 +52,8 @@ class Entry : public EntryIfaces * @param[in] severityErr - The severity of the error. * @param[in] msgErr - The message of the error. * @param[in] additionalDataErr - The error metadata. + * @param[in] objects - The list of associations. + * @param[in] fwVersion - The BMC code version. * @param[in] parent - The error's parent. */ Entry(sdbusplus::bus::bus& bus, @@ -60,6 +64,7 @@ class Entry : public EntryIfaces std::string&& msgErr, std::vector<std::string>&& additionalDataErr, AssociationList&& objects, + const std::string& fwVersion, internal::Manager& parent) : EntryIfaces(bus, path.c_str(), true), parent(parent) @@ -75,6 +80,9 @@ class Entry : public EntryIfaces sdbusplus::xyz::openbmc_project:: Logging::server::Entry::resolved(false); + version(fwVersion); + purpose(VersionPurpose::BMC); + // Emit deferred signal. this->emit_object_added(); }; |