Fix being able to activate a Failed version
When an activation fails, the version is marked as Failed.
On a subsequent activation, the bmc updater core dumps due
to 2 issues during the freeSpace call:
1. The Failed activation doesn't have a Priority object, so
default its priority to a large value.
2. If the subsequent activation is to the same version id,
then freeSpace should not do an erase on it, because that
removes the activations object that it's trying to activate.
Tested: Verified that doing an activation after a version
was marked as Failed did not core dump the updater anymore.
Change-Id: Iba36497b53738e00283cfec55e8c666f943cd5d5
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/item_updater.hpp b/item_updater.hpp
index 12583f5..ac966ca 100644
--- a/item_updater.hpp
+++ b/item_updater.hpp
@@ -143,8 +143,10 @@
* needs to delete any BMC version(s) it will delete the
* version(s) with the highest priority, skipping the
* functional BMC version.
+ *
+ * @param[in] caller - The Activation object that called this function.
*/
- void freeSpace();
+ void freeSpace(Activation& caller);
private:
/** @brief Callback function for Software.Version match.