Software: Add RequestedRedundancyPriority

The current design requires that RedundancyPriority interfaces are only
created on Activated software versions.  There is a need for a user to
be able to specified a desired-RedundancyPriority prior to Activation so
that the Activation happens to the correct "slot" in a static-image
config.  Add a RequestedRedundancyPriority interface to facilitate this
and ensure that it is done in a backwards-compatible way so that
existing software update implementations are not affected.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I52df2e520f42ffb36e134166d6526a320c2fa013
diff --git a/xyz/openbmc_project/Software/README.md b/xyz/openbmc_project/Software/README.md
index 9907732..f13d04c 100644
--- a/xyz/openbmc_project/Software/README.md
+++ b/xyz/openbmc_project/Software/README.md
@@ -151,6 +151,14 @@
 as *Active* and the `Priority` shows which version is the primary and which are
 available for redundancy.
 
+Prior to `Activation`, it can be useful to indicate a desired
+`RedundancyPriority`.  This can be done by setting the `Priority` on the
+`RequestedRedundancyPriority` interface.  Some *ItemUpdater* implementations
+may not honor this field or be unable to comply with the request, in which
+case the resulting `Activation` may result in one of two conditions: a
+`ActivationState = Failed` or an `ActivateState = Active`` with a
+`RedundancyPriority = 0 (High)`.
+
 ## REST use-cases
 
 ### Find all software versions on the system, either active or available.
diff --git a/xyz/openbmc_project/Software/RequestedRedundancyPriority.interface.yaml b/xyz/openbmc_project/Software/RequestedRedundancyPriority.interface.yaml
new file mode 100644
index 0000000..141b147
--- /dev/null
+++ b/xyz/openbmc_project/Software/RequestedRedundancyPriority.interface.yaml
@@ -0,0 +1,20 @@
+description: >
+    The requested priority, for redundancy purposes, of the associated
+    `xyz.openbmc_project.Software.Version` prior to its activation.
+properties:
+    - name: Priority
+      type: byte
+      default: 0
+      description: >
+          Upon Activation of the software Version, the *ItemUpdater*
+          should attempt to activate the software version such that
+          the resulting `Software.RedundancyPriority.Priority` is Priority.
+
+          See `Software.RedundancyPriority.Priority` for valid values and
+          definitions.
+
+          By default, any Activation should be done to the highest priority.
+          Some *ItemUpdater* implementations may be unable to apply this
+          `RequestedRedundancyPriority.Priority`, resulting in an
+          `ActivationState` which is either `Failed` or `Active` with
+          `Priority` of `0 (High)`.