Prime FRUs if only required
As vpd-manager primes the FRUs listed in the system config JSON on each
system boot, which takes significant time.
To improve the efficiency, this commit implements priming of FRUs only
if the Dbus object paths having “com.ibm.VPD.Collection" interface
count does not match with the inventoryPaths count from the system
config JSON.
Change-Id: I506503b8e8ad64342352a9aae3c889b9fd5a22d8
Signed-off-by: Anupama B R <anupama.b.r1@ibm.com>
diff --git a/vpd-manager/oem-handler/ibm_handler.hpp b/vpd-manager/oem-handler/ibm_handler.hpp
index 3a6ea42..a397f06 100644
--- a/vpd-manager/oem-handler/ibm_handler.hpp
+++ b/vpd-manager/oem-handler/ibm_handler.hpp
@@ -145,6 +145,19 @@
*/
void enableMuxChips();
+ /**
+ * @brief API to check if priming is required.
+ *
+ * The API will traverse the system config JSON and counts the FRU
+ * paths which qualifies for priming and compares with count of object paths
+ * found under PIM which hosts the "com.ibm.VPD.Collection" interface. If
+ * the dbus count is equal to or greater than the count from JSON config
+ * consider as priming is not required.
+ *
+ * @return true if priming is required, false otherwise.
+ */
+ bool isPrimingRequired() const noexcept;
+
// Parsed system config json object.
nlohmann::json m_sysCfgJsonObj{};