psu-ng: Only log missing errors for required PSUs

If a power supply unit (PSU) is missing, only log an error if it is
required by the current SupportedConfiguration.

EntityManager provides one or more D-Bus objects that implement the
SupportedConfiguration interface.  This interface specifies a PSU model,
input voltage, and required number of PSUs.

EntityManager also provides one or more D-Bus objects that represent
possible PSU devices that could exist in the system.

If the number of required PSUs is less than the number of possible PSUs,
it is not an error for the extra PSUs to be missing.

Add logic to the power supply monitoring application to determine if a
missing PSU is required before logging an error.

Tested:
* Test plan documented at
  https://gist.github.com/smccarney/ba99ac808503b477aa056e7f4afe2ae1

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I2e8d147ad88461077da497b26fcc309966e04b45
diff --git a/phosphor-power-supply/psu_manager.hpp b/phosphor-power-supply/psu_manager.hpp
index d471212..fff6a19 100644
--- a/phosphor-power-supply/psu_manager.hpp
+++ b/phosphor-power-supply/psu_manager.hpp
@@ -314,6 +314,22 @@
     bool hasRequiredPSUs(std::map<std::string, std::string>& additionalData);
 
     /**
+     * @brief Returns the number of PSUs that are required to be present.
+     *
+     * @return required number of PSUs, or 0 if the number could not be
+     *         determined.
+     */
+    unsigned int getRequiredPSUCount();
+
+    /**
+     * @brief Returns whether the specified PSU is required to be present.
+     *
+     * @param[in] psu - Power supply to check
+     * @return true if PSU is required, false otherwise.
+     */
+    bool isRequiredPSU(const PowerSupply& psu);
+
+    /**
      * @brief Helper function to validate that all PSUs have the same model name
      *
      * @param[out] model - The model name. Empty if there is a mismatch.