settings: remove connection tracking from NMManager
NMSysconfigSettings has the authoritative list of connections, no reason to duplicate all that tracking code in NMManager. Add the missing bits that the manager had to NMSysconfigSettings, and point NMPolicy at the settings object instead of NMManager for that.
This commit is contained in:
15
src/main.c
15
src/main.c
@@ -453,6 +453,7 @@ main (int argc, char *argv[])
|
||||
NMDBusManager *dbus_mgr = NULL;
|
||||
NMSupplicantManager *sup_mgr = NULL;
|
||||
NMDHCPManager *dhcp_mgr = NULL;
|
||||
NMSysconfigSettings *settings = NULL;
|
||||
GError *error = NULL;
|
||||
gboolean wrote_pidfile = FALSE;
|
||||
char *cfg_log_level = NULL, *cfg_log_domains = NULL;
|
||||
@@ -672,7 +673,14 @@ main (int argc, char *argv[])
|
||||
goto done;
|
||||
}
|
||||
|
||||
manager = nm_manager_get (config,
|
||||
settings = nm_sysconfig_settings_new (config, plugins, &error);
|
||||
if (!settings) {
|
||||
nm_log_err (LOGD_CORE, "failed to initialize settings storage.");
|
||||
goto done;
|
||||
}
|
||||
|
||||
manager = nm_manager_get (settings,
|
||||
config,
|
||||
plugins,
|
||||
state_file,
|
||||
net_enabled,
|
||||
@@ -685,7 +693,7 @@ main (int argc, char *argv[])
|
||||
goto done;
|
||||
}
|
||||
|
||||
policy = nm_policy_new (manager, vpn_manager);
|
||||
policy = nm_policy_new (manager, vpn_manager, settings);
|
||||
if (policy == NULL) {
|
||||
nm_log_err (LOGD_CORE, "failed to initialize the policy.");
|
||||
goto done;
|
||||
@@ -733,6 +741,9 @@ done:
|
||||
if (manager)
|
||||
g_object_unref (manager);
|
||||
|
||||
if (settings)
|
||||
g_object_unref (settings);
|
||||
|
||||
if (vpn_manager)
|
||||
g_object_unref (vpn_manager);
|
||||
|
||||
|
Reference in New Issue
Block a user