psu-ng: Handle health rollup based on availability

When a PSU is set to not available, create an association between the
power supply and its chassis as a way to 'roll up' the health status to
that chassis.  It looks like:

    <chassis>/critical
        endpoints: <power supply>
    <power supply>/health_rollup
        endpoints: <chassis>

There is Redfish code that look at the endpoints in that chassis
association object to determine if the chassis health is OK or not.

Note that some systems, such as IBM's, have other code that will fill
in that association when it is called out in an event log, which is why
this code doesn't have to do it for every single fault.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I262dd738ebadb72aa207011941066fc282bfe4df
diff --git a/phosphor-power-supply/util_base.hpp b/phosphor-power-supply/util_base.hpp
index bb7dc3c..576a965 100644
--- a/phosphor-power-supply/util_base.hpp
+++ b/phosphor-power-supply/util_base.hpp
@@ -28,6 +28,10 @@
     virtual void setAvailable(sdbusplus::bus::bus& bus,
                               const std::string& invpath,
                               bool available) const = 0;
+
+    virtual void handleChassisHealthRollup(sdbusplus::bus::bus& bus,
+                                           const std::string& invpath,
+                                           bool addRollup) const = 0;
 };
 
 const UtilBase& getUtils();
@@ -49,6 +53,13 @@
     getUtils().setAvailable(bus, invpath, available);
 }
 
+inline void handleChassisHealthRollup(sdbusplus::bus::bus& bus,
+                                      const std::string& invpath,
+                                      bool addRollup)
+{
+    getUtils().handleChassisHealthRollup(bus, invpath, addRollup);
+}
+
 class GPIOInterfaceBase
 {
   public: