Specify PEL callout priority and sort callouts.
Allow the priority to be passed in at creation time by calling the
CALLOUT_PRIORITY keyword. When creating a PEL, callouts will always
be sorted by priority instead of creation time, the order is as follows:
H,M,A,B,C,L.
Signed-off-by: Miguel Gomez <mgomez@mx1.ibm.com>
Change-Id: I84345aaf3fad7b2e4958b698ab761966f499986b
diff --git a/extensions/openpower-pels/src.cpp b/extensions/openpower-pels/src.cpp
index 3fd62e8..643adec 100644
--- a/extensions/openpower-pels/src.cpp
+++ b/extensions/openpower-pels/src.cpp
@@ -748,7 +748,19 @@
getRegistryCallouts(regEntry, additionalData, dataIface);
auto item = additionalData.getValue("CALLOUT_INVENTORY_PATH");
+ auto priority = additionalData.getValue("CALLOUT_PRIORITY");
+ std::optional<CalloutPriority> calloutPriority;
+
+ // Only H, M or L priority values.
+ if (priority && !(*priority).empty())
+ {
+ uint8_t p = (*priority)[0];
+ if (p == 'H' || p == 'M' || p == 'L')
+ {
+ calloutPriority = static_cast<CalloutPriority>(p);
+ }
+ }
// If the first registry callout says to use the passed in inventory
// path to get the location code for a symbolic FRU callout with a
// trusted location code, then do not add the inventory path as a
@@ -759,7 +771,7 @@
if (item && !useInvForSymbolicFRULocCode)
{
- addInventoryCallout(*item, std::nullopt, std::nullopt, dataIface);
+ addInventoryCallout(*item, calloutPriority, std::nullopt, dataIface);
}
addDevicePathCallouts(additionalData, dataIface);