PNOR: implement Software RedundancyPriority interface.

- Create override function for redundancepriority.
- Update RedundancyPriority for image that holds that
  already holds the requested priority.

Resolves openbmc/openbmc#1553

Change-Id: I1a5c35826c881f6e9e21550c664b033c6f4b4bc0
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
diff --git a/item_updater.cpp b/item_updater.cpp
index 3fff1a4..bf4ba38 100755
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -107,6 +107,7 @@
                 std::make_unique<Activation>(
                         bus,
                         path,
+                        *this,
                         versionId,
                         extendedVersion,
                         activationState)));
@@ -207,6 +208,21 @@
     return;
 }
 
+void ItemUpdater::freePriority(uint8_t value)
+{
+    //TODO openbmc/openbmc#1896 Improve the performance of this function
+    for (const auto& intf : activations)
+    {
+        if(intf.second->redundancyPriority)
+        {
+            if (intf.second->redundancyPriority.get()->priority() == value)
+            {
+                intf.second->redundancyPriority.get()->priority(value+1);
+            }
+        }
+    }
+}
+
 } // namespace updater
 } // namespace software
 } // namespace openpower