From bbc2908635ca3ded9162504683fa126809f0ec14 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Wed, 5 Aug 2015 17:47:45 +0200 Subject: core: dbus: track bus names per unit Currently, PID1 installs an unfiltered NameOwnerChanged signal match, and dispatches the signals itself. This does not scale, as right now, PID1 wakes up every time a bus client connects. To fix this, install individual matches once they are requested by unit_watch_bus_name(), and remove the watches again through their slot in unit_unwatch_bus_name(). If the bus is not available during unit_watch_bus_name(), just store name in the 'watch_bus' hashmap, and let bus_setup_api() do the installing later. --- src/core/manager.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'src/core/manager.c') diff --git a/src/core/manager.c b/src/core/manager.c index ba107d4615..ecea89c377 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -2187,24 +2187,6 @@ void manager_send_unit_plymouth(Manager *m, Unit *u) { log_error_errno(errno, "Failed to write Plymouth message: %m"); } -void manager_dispatch_bus_name_owner_changed( - Manager *m, - const char *name, - const char* old_owner, - const char *new_owner) { - - Unit *u; - - assert(m); - assert(name); - - u = hashmap_get(m->watch_bus, name); - if (!u) - return; - - UNIT_VTABLE(u)->bus_name_owner_change(u, name, old_owner, new_owner); -} - int manager_open_serialization(Manager *m, FILE **_f) { const char *path; int fd = -1; -- cgit v1.2.3-54-g00ecf