entity_association_tree: Keep tree always updated

This commit keeps the entity association tree updated across Host
reboots. It deletes the Host entries from the entity associaton
tree when Host is powered off.

Without this fix the entity association tree keeps on growing with
duplicate Host entries during each power on(PDR exchange) resulting
a crash of pldm daemon after few power on-off sequence

Change-Id: I8fdc258195aef998d10e33577f3ec98da48b3d40
Signed-off-by: Sampa Misra <sampmisr@in.ibm.com>
diff --git a/host-bmc/host_pdr_handler.hpp b/host-bmc/host_pdr_handler.hpp
index a8866a2..8e898af 100644
--- a/host-bmc/host_pdr_handler.hpp
+++ b/host-bmc/host_pdr_handler.hpp
@@ -89,6 +89,7 @@
                             sdeventplus::Event& event, pldm_pdr* repo,
                             const std::string& eventsJsonsDir,
                             pldm_entity_association_tree* entityTree,
+                            pldm_entity_association_tree* bmcEntityTree,
                             Requester& requester, bool verbose = false);
 
     /** @brief fetch PDRs from host firmware. See @class.
@@ -173,8 +174,12 @@
     pldm_pdr* repo;
 
     StateSensorHandler stateSensorHandler;
-    /** @brief Pointer to BMC's entity association tree */
+    /** @brief Pointer to BMC's and Host's entity association tree */
     pldm_entity_association_tree* entityTree;
+
+    /** @brief Pointer to BMC's entity association tree */
+    pldm_entity_association_tree* bmcEntityTree;
+
     /** @brief reference to Requester object, primarily used to access API to
      *  obtain PLDM instance id.
      */