summaryrefslogtreecommitdiff
path: root/src/settings/nm-agent-manager.c
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2015-07-14 16:53:24 +0200
committerThomas Haller <thaller@redhat.com>2015-09-18 17:32:11 +0200
commit06da3532428e3498c1e808ff8be1af48b540a6ff (patch)
tree80155896a11d61517bc7cb87df16b3f0ede16f25 /src/settings/nm-agent-manager.c
parentc9b3617c35b3380428a1800e8aa6692ee68b4b74 (diff)
downloadNetworkManager-06da3532428e3498c1e808ff8be1af48b540a6ff.tar.gz
core: separate active and applied connection
Clone the connection upon activation. This makes it safe for the user to modify the original connection while it is activated. This involves several changes: - NMActiveConnection gets @settings_connection and @applied_connection. To support add-and-activate, we constructing a NMActiveConnection with no connection set. Previously, we would set the "connection" field to a temporary NMConnection. Now NMManager piggybacks this temporary connection as object-data (TAG_ACTIVE_CONNETION_ADD_AND_ACTIVATE). - get rid of the functions nm_active_connection_get_connection_type() and nm_active_connection_get_connection_uuid(). From their names it is unclear whether this returns the settings or applied connection. The (few) callers should figure that out themselves. - rename nm_active_connection_get_id() to nm_active_connection_get_settings_connection_id(). This function is only used internally for logging. - dispatcher calls now get two connections as well. The applied-connection is used for the connection data, while the settings-connection is used for the connection path. - needs special handling for properties that apply immediately when changed (nm_device_reapply_settings_immediately()). Co-Authored-By: Thomas Haller <thaller@redhat.com> https://bugzilla.gnome.org/show_bug.cgi?id=724041
Diffstat (limited to 'src/settings/nm-agent-manager.c')
-rw-r--r--src/settings/nm-agent-manager.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/settings/nm-agent-manager.c b/src/settings/nm-agent-manager.c
index 2bdb41baee..c3abaac25c 100644
--- a/src/settings/nm-agent-manager.c
+++ b/src/settings/nm-agent-manager.c
@@ -474,8 +474,6 @@ struct _NMAgentManagerCallId {
NMAgentSecretsResultFunc callback;
gpointer callback_data;
- gpointer other_data2;
- gpointer other_data3;
} get;
};
} con;
@@ -564,9 +562,7 @@ req_complete_release (Request *req,
req->con.get.flags,
error ? NULL : secrets,
error,
- req->con.get.callback_data,
- req->con.get.other_data2,
- req->con.get.other_data3);
+ req->con.get.callback_data);
break;
case REQUEST_TYPE_CON_SAVE:
@@ -1167,8 +1163,6 @@ _con_get_try_complete_early (Request *req)
* @hints:
* @callback:
* @callback_data:
- * @other_data2:
- * @other_data3:
*
* Requests secrets for a connection.
*
@@ -1190,17 +1184,15 @@ nm_agent_manager_get_secrets (NMAgentManager *self,
NMSecretAgentGetSecretsFlags flags,
const char **hints,
NMAgentSecretsResultFunc callback,
- gpointer callback_data,
- gpointer other_data2,
- gpointer other_data3)
+ gpointer callback_data)
{
NMAgentManagerPrivate *priv = NM_AGENT_MANAGER_GET_PRIVATE (self);
Request *req;
- g_return_val_if_fail (self != NULL, 0);
- g_return_val_if_fail (path && *path, 0);
- g_return_val_if_fail (NM_IS_CONNECTION (connection), 0);
- g_return_val_if_fail (callback != NULL, 0);
+ g_return_val_if_fail (self != NULL, NULL);
+ g_return_val_if_fail (path && *path, NULL);
+ g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
+ g_return_val_if_fail (callback != NULL, NULL);
nm_log_dbg (LOGD_SETTINGS,
"Secrets requested for connection %s (%s/%s)",
@@ -1227,8 +1219,6 @@ nm_agent_manager_get_secrets (NMAgentManager *self,
req->con.get.flags = flags;
req->con.get.callback = callback;
req->con.get.callback_data = callback_data;
- req->con.get.other_data2 = other_data2;
- req->con.get.other_data3 = other_data3;
if (!g_hash_table_add (priv->requests, req))
g_assert_not_reached ();