summaryrefslogtreecommitdiffstats
path: root/serialize.hpp
diff options
context:
space:
mode:
authorSaqib Khan <khansa@us.ibm.com>2017-08-09 10:44:50 -0500
committerPatrick Williams <patrick@stwcx.xyz>2017-08-20 23:21:27 +0000
commit5d53267584b3b8a69163a5598e789157195f6889 (patch)
tree8b0a6ef5eb4652fbec6311b0f5b301464a861f50 /serialize.hpp
parentb1cfdf99c4b9cccccb21f34150d962004dfa4fef (diff)
downloadphosphor-bmc-code-mgmt-5d53267584b3b8a69163a5598e789157195f6889.tar.gz
phosphor-bmc-code-mgmt-5d53267584b3b8a69163a5598e789157195f6889.zip
BMC: Store RedundancyPriority on System.
This commit extends the functionality of the BMC software updater by preserving RedundancyPriority values through any kind of reset. This is accomplished by storing priority values in serial files in /var/lib/obmc/phosphor-bmc-code-mgmt/ using the Cereal library. Each time a priority value is modified, the value in the corresponding version file is adjusted. Resolves openbmc/openbmc#2125 Change-Id: Ie697279895bc5ff5fdef31fa88c78dc2bc63390a Signed-off-by: Saqib Khan <khansa@us.ibm.com>
Diffstat (limited to 'serialize.hpp')
-rw-r--r--serialize.hpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/serialize.hpp b/serialize.hpp
new file mode 100644
index 0000000..7b6461f
--- /dev/null
+++ b/serialize.hpp
@@ -0,0 +1,34 @@
+#pragma once
+
+#include <experimental/filesystem>
+#include "config.h"
+
+namespace phosphor
+{
+namespace software
+{
+namespace updater
+{
+
+namespace fs = std::experimental::filesystem;
+
+/** @brief Serialization function - stores activation information to file
+ * @param[in] versionId - The version for which to store information.
+ * @param[in] priority - RedundancyPriority value for that version.
+ **/
+void storeToFile(std::string versionId, uint8_t priority);
+
+/** @brief Serialization function - restores activation information from file
+ * @param[in] versionId - The version for which to retrieve information.
+ * @param[in] priority - RedundancyPriority reference for that version.
+ **/
+void restoreFromFile(std::string versionId, uint8_t& priority);
+
+/** @brief Removes the serial file for a given version.
+ * @param[in] versionId - The version for which to remove a file, if it exists.
+ **/
+void removeFile(std::string versionId);
+
+} // namespace phosphor
+} // namespace software
+} // namespace openpower
OpenPOWER on IntegriCloud