Persist changes to 'Resolved' property
When an error is marked resolved, serialize and persist the changed
'Resolved' property.
Change-Id: I922af84cbb826e1e43a0f0c99740868222ccb1fe
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/elog_entry.cpp b/elog_entry.cpp
index 07a2854..74fcc4b 100644
--- a/elog_entry.cpp
+++ b/elog_entry.cpp
@@ -1,5 +1,6 @@
#include "elog_entry.hpp"
#include "log_manager.hpp"
+#include "elog_serialize.hpp"
namespace phosphor
{
@@ -13,5 +14,22 @@
parent.erase(id());
}
+bool Entry::resolved(bool value)
+{
+ auto current = sdbusplus::xyz::openbmc_project::
+ Logging::server::Entry::resolved();
+ if (value != current)
+ {
+ value ?
+ associations({}) :
+ associations(assocs);
+ current = sdbusplus::xyz::openbmc_project::
+ Logging::server::Entry::resolved(value);
+ serialize(*this);
+ }
+
+ return current;
+}
+
} // namespace logging
} // namepsace phosphor
diff --git a/elog_entry.hpp b/elog_entry.hpp
index ffff8af..b3d5963 100644
--- a/elog_entry.hpp
+++ b/elog_entry.hpp
@@ -69,7 +69,8 @@
associations(std::move(objects));
// Store a copy of associations in case we need to recreate
assocs = associations();
- resolved(false);
+ sdbusplus::xyz::openbmc_project::
+ Logging::server::Entry::resolved(false);
// Emit deferred signal.
this->emit_object_added();
@@ -98,15 +99,8 @@
* status (true = resolved)
* @returns value of 'Resolved' property
*/
- bool resolved(bool value) override
- {
- value ?
- associations({}) :
- associations(assocs);
+ bool resolved(bool value) override;
- return sdbusplus::xyz::openbmc_project::
- Logging::server::Entry::resolved(value);
- }
using sdbusplus::xyz::openbmc_project::
Logging::server::Entry::resolved;