PEL: Check if PEL pruning necessary on a new PEL

When a new PEL is added check if the size of all PELs is now more than
95% of the maximum capacity.  If it is, call the repository's prune()
function from the event loop to make more space.  Also delete the
OpenBMC event logs corresponding to the PELs that were just deleted.

It's called from the event loop so that the current D-Bus method
response that the code is in now can return to the caller first.

It tops out at 95% to ensure that we never go over.  It's possible this
can be tuned in the future, but at the current 20MB limit that still
allows 19MB before pruning will take it down to at most 18MB.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I962866eceee89cd605fcd36ec08b20ff762fe6cd
diff --git a/extensions/openpower-pels/repository.hpp b/extensions/openpower-pels/repository.hpp
index f33289c..c7cb39a 100644
--- a/extensions/openpower-pels/repository.hpp
+++ b/extensions/openpower-pels/repository.hpp
@@ -357,6 +357,16 @@
     static bool isServiceableSev(const PELAttributes& pel);
 
     /**
+     * @brief Returns true if the total amount of disk space occupied
+     *        by the PELs in the repo is over 95% of the maximum
+     *        size, or if there are over the maximum number of
+     *        PELs allowed.
+     *
+     * @return bool - true if repo is > 95% full or too many PELs
+     */
+    bool sizeWarning() const;
+
+    /**
      * @brief Deletes PELs to bring the repository size down
      *        to at most 90% full by placing PELs into 4 different
      *        catogories and then removing PELs until those catogories