diff options
author | Thomas Haller <thaller@redhat.com> | 2018-04-21 13:25:57 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-04-22 10:19:35 +0200 |
commit | 3cedc1bf533081809c9ec60e064ee3b497578b13 (patch) | |
tree | 002f287529a738c6743a3721af2d732c928fccbc /src/nm-manager.c | |
parent | 0a24b6ce90d86eaf9a91c63b1982171b9f038b5b (diff) | |
download | NetworkManager-th/core-fixes-for-shutdown.tar.gz |
core/dbus: stop NMDBusManager and reject future method callsth/core-fixes-for-shutdown
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
Diffstat (limited to 'src/nm-manager.c')
-rw-r--r-- | src/nm-manager.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c index fd341538a3..0ffc33f385 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -5918,7 +5918,6 @@ nm_manager_stop (NMManager *self) NMDevice *device; /* FIXME(shutdown): we don't do a proper shutdown yet: - * - need to tell NMDBusManager that all future D-Bus requests are rejected * - need to ensure that all pending async operations are cancelled * - e.g. operations in priv->async_op_lst_head * - need to ensure that no more asynchronous requests are started, @@ -5931,6 +5930,8 @@ nm_manager_stop (NMManager *self) * - e.g. see comment at nm_auth_manager_force_shutdown() */ + nm_dbus_manager_stop (nm_dbus_object_get_manager (NM_DBUS_OBJECT (self))); + while ((device = c_list_first_entry (&priv->devices_lst_head, NMDevice, devices_lst))) remove_device (self, device, TRUE, TRUE); |