entity-manager: move dbusMatches to class
```
static boost::container::flat_map<std::string, sdbusplus::bus::match_t>
dbusMatches;
```
is moved to EntityManager class as
```
boost::container::flat_map<std::string, sdbusplus::bus::match_t>
dbusMatches;
```
to get rid of the static variable.
Tested: on Tyan S8030. Matches are created without issue.
The debug level logging helps to confirm.
```
Jul 01 10:27:42 s8030-bmc-30303035c0c1 entity-manager[5010]: creating PropertiesChanged match on /xyz/openbmc_project/FruDevice/ConnectX_6_Dx_100GE_2P_NIC
Jul 01 10:27:42 s8030-bmc-30303035c0c1 entity-manager[5010]: creating PropertiesChanged match on /xyz/openbmc_project/FruDevice/PWS_920P_SQ
Jul 01 10:27:42 s8030-bmc-30303035c0c1 entity-manager[5010]: creating PropertiesChanged match on /xyz/openbmc_project/FruDevice/PWS_920P_SQ_0
Jul 01 10:27:42 s8030-bmc-30303035c0c1 entity-manager[5010]: creating PropertiesChanged match on /xyz/openbmc_project/FruDevice/S8030GM2NE
```
Change-Id: I9918f0f6e81aac55a174e3ee97e2cd7ff56ef2f3
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/src/entity_manager/entity_manager.cpp b/src/entity_manager/entity_manager.cpp
index 8de134a..31e7ef4 100644
--- a/src/entity_manager/entity_manager.cpp
+++ b/src/entity_manager/entity_manager.cpp
@@ -23,6 +23,7 @@
#include "dbus_interface.hpp"
#include "overlay.hpp"
#include "perform_scan.hpp"
+#include "phosphor-logging/lg2.hpp"
#include "topology.hpp"
#include "utils.hpp"
@@ -621,14 +622,13 @@
void EntityManager::registerCallback(const std::string& path)
{
- static boost::container::flat_map<std::string, sdbusplus::bus::match_t>
- dbusMatches;
-
if (dbusMatches.contains(path))
{
return;
}
+ lg2::debug("creating PropertiesChanged match on {PATH}", "PATH", path);
+
std::function<void(sdbusplus::message_t & message)> eventHandler =
[&](sdbusplus::message_t&) { propertiesChangedCallback(); };