entity-manager: scan after ObjectManager signals
Trigger a rescan whenever interfaces are added or removed, since they
might result in a probe event.
The schema of ObjectManager signals does not allow us to match the
specific interfaces in our probes so we are stuck subscribing to all
events from all services. Rescans could be avoided however, with a
custom signal handler with wrapper logic that discards wakeups without a
rescan if the interfaces added (or removed) are not in our list of probe
interfaces.
Change-Id: I834db793ebe05305248a02cb04b601ff0cc6a1ff
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/src/EntityManager.cpp b/src/EntityManager.cpp
index 14c8179..aa1df20 100644
--- a/src/EntityManager.cpp
+++ b/src/EntityManager.cpp
@@ -1862,6 +1862,20 @@
[&](sdbusplus::message::message&) {
propertiesChangedCallback(systemConfiguration, objServer);
});
+ // We also need a poke from DBus when new interfaces are created or
+ // destroyed.
+ sdbusplus::bus::match::match interfacesAddedMatch(
+ static_cast<sdbusplus::bus::bus&>(*SYSTEM_BUS),
+ sdbusplus::bus::match::rules::interfacesAdded(),
+ [&](sdbusplus::message::message&) {
+ propertiesChangedCallback(systemConfiguration, objServer);
+ });
+ sdbusplus::bus::match::match interfacesRemovedMatch(
+ static_cast<sdbusplus::bus::bus&>(*SYSTEM_BUS),
+ sdbusplus::bus::match::rules::interfacesRemoved(),
+ [&](sdbusplus::message::message&) {
+ propertiesChangedCallback(systemConfiguration, objServer);
+ });
io.post(
[&]() { propertiesChangedCallback(systemConfiguration, objServer); });