fix item updater freeSpace()
Fixed freeSpace() to remove more than 1 version if that is what is
needed to get the number of active PNOR versions at
ACTIVE_PNOR_MAX_ALLOWED -1. Currently, ACTIVE_PNOR_MAX_ALLOWED is
set to 2. We have seen cases where there are 3 active PNOR versions.
In those cases, freeSpace() only removes 1 active PNOR version, when
it should remove 2 to bring the total number of active PNOR
versions to 1.
Resolves openbmc/openbmc#2806
Change-Id: I0e9f5b6835298ae86091848f889bbc316e0a7f57
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/item_updater.hpp b/item_updater.hpp
index f09891c..7b37e4d 100755
--- a/item_updater.hpp
+++ b/item_updater.hpp
@@ -141,8 +141,12 @@
*/
void deleteAll();
- /** @brief Deletes the active PNOR version with highest priority
- if the total number of volumes exceeds the threshold.
+ /** @brief Brings the total number of active PNOR versions to
+ * ACTIVE_PNOR_MAX_ALLOWED -1. This function is intended to be
+ * run before activating a new PNOR version. If this function
+ * needs to delete any PNOR version(s) it will delete the
+ * version(s) with the highest priority, skipping the
+ * functional PNOR version.
*/
void freeSpace();