summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2017-11-09 15:05:04 -0600
committerAdriana Kobylak <anoo@us.ibm.com>2017-11-09 15:08:53 -0600
commitee201a5ca4bb67b2b8337f9a5ac3c50f3673040d (patch)
treef690e80b126de73b78639c2301ab8c23822785ff
parent0e30f86cb44f3ab0aa4080faf32eb4bf2a9b12b2 (diff)
downloadopenpower-pnor-code-mgmt-ee201a5ca4bb67b2b8337f9a5ac3c50f3673040d.tar.gz
openpower-pnor-code-mgmt-ee201a5ca4bb67b2b8337f9a5ac3c50f3673040d.zip
item_updater: Skip functional version when freeing space
After the code update, the newly activated version would have a priority value of 0. If the host is not rebooted, the functional version would still be the old version but it'd now have a priority value of 1. If another code update is requested at this point, the function that frees up space would try to remove the highest priority version which is the running one. Add a check to ignore the version if it's the functional one, also allow a version of priority 0 to be deleted. Change-Id: I077ea2eeff68e07af533103f292be592326b5111 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
-rw-r--r--item_updater.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/item_updater.cpp b/item_updater.cpp
index 05fbe008d..adc6f7cab 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -532,7 +532,11 @@ void ItemUpdater::freeSpace()
if (iter.second.get()->activation() == server::Activation::Activations::Active)
{
count++;
- if (iter.second->redundancyPriority.get()->priority() > highestPriority)
+ if (isVersionFunctional(iter.second->versionId))
+ {
+ continue;
+ }
+ if (iter.second->redundancyPriority.get()->priority() >= highestPriority)
{
highestPriority = iter.second->redundancyPriority.get()->priority();
highestPriorityVersion = iter.second->versionId;
OpenPOWER on IntegriCloud