Restore Callout objects
Restore any saved Callout objects when the application starts
up and creates its interfaces for all existing error logs.
For each error log, it will look in the save directory for it
to find any saved Callout files. If there is one, it will
restore a Callout object from it.
The default path it looks in is:
/var/lib/ibm-logging/errors/N/callouts/ where N is an error
log entry ID.
The code will look for all numerically named files in that
directory to restore. If it is unsuccessful, it will delete
the file since it is corrupt and move on to the next one.
Tested: Restart ibm-log-manager and check that the callout
objects were preserved via looking at D-Bus.
Resolves openbmc/openbmc#2973
Change-Id: I8bc1dac3748a39e2c3a33d763e75ff90e5da668e
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/manager.hpp b/manager.hpp
index b84a4c7..39cf958 100644
--- a/manager.hpp
+++ b/manager.hpp
@@ -197,6 +197,18 @@
const DbusInterfaceMap& interfaces);
/**
+ * Restores callout objects for a particular error log that
+ * have previously been saved by reading their data out of
+ * the filesystem using Cereal.
+ *
+ * @param[in] objectPath - object path of the error log
+ * @param[in] interfaces - map of all interfaces and properties
+ * on a phosphor-logging error log.
+ */
+ void restoreCalloutObjects(const std::string& objectPath,
+ const DbusInterfaceMap& interfaces);
+
+ /**
* Returns the entry ID for a log
*
* @param[in] objectPath - the object path of the log