core/dbus: stop NMDBusManager and reject future method calls

During shutdown, we will need to still iterate the main loop
to do a coordinated shutdown. Currently we do not, and we just
exit, leaving a lot of objects hanging.

If we are going to fix that, we need during shutdown tell
NMDBusManager to reject all future operations.

Note that property getters and "GetManagerObjects" call is not
blocked. It continues to work.

Certainly for some operations, we want to allow them to be called even
during shutdown. However, these have to opt-in.

This also fixes an uglyness, where nm_dbus_manager_start() would
get the set-property-handler and the @manager as user-data. However,
NMDBusManager will always outlife NMManager, hence, after NMManager
is destroyed, the user-data would be a dangling pointer. Currently
that is not an issue, because
  - we always leak NMManager
  - we don't run the mainloop during shutdown
This commit is contained in:
Thomas Haller
2018-04-21 13:25:57 +02:00
parent 5b199b2e7d
commit 3d2da8cd05
8 changed files with 53 additions and 25 deletions

View File

@@ -122,6 +122,7 @@ typedef struct _NMDBusMethodInfoExtended {
const char *sender,
GDBusMethodInvocation *invocation,
GVariant *parameters);
bool allow_during_shutdown;
} NMDBusMethodInfoExtended;
#define NM_DEFINE_DBUS_METHOD_INFO_EXTENDED(parent_, ...) \