diff --git a/src/nm-checkpoint.c b/src/nm-checkpoint.c index 39a6c255cf..405baf5743 100644 --- a/src/nm-checkpoint.c +++ b/src/nm-checkpoint.c @@ -256,7 +256,9 @@ activate: nm_settings_connection_get_uuid (connection)); nm_settings_connection_commit_changes (connection, dev_checkpoint->settings_connection, + NM_SETTINGS_CONNECTION_PERSIST_MODE_DISK, NM_SETTINGS_CONNECTION_COMMIT_REASON_NONE, + "checkpoint-rollback", NULL); } } else { diff --git a/src/nm-manager.c b/src/nm-manager.c index 9fae8f45b9..00dac4fbd7 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -4024,7 +4024,9 @@ activation_add_done (NMSettings *settings, if (_internal_activate_generic (self, active, &local)) { nm_settings_connection_commit_changes (new_connection, NULL, + NM_SETTINGS_CONNECTION_PERSIST_MODE_DISK, NM_SETTINGS_CONNECTION_COMMIT_REASON_USER_ACTION | NM_SETTINGS_CONNECTION_COMMIT_REASON_ID_CHANGED, + "add-and-activate", NULL); g_dbus_method_invocation_return_value ( context, diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c index 2f6d2f2180..b8c1faa04c 100644 --- a/src/settings/nm-settings-connection.c +++ b/src/settings/nm-settings-connection.c @@ -696,16 +696,16 @@ out: gboolean nm_settings_connection_commit_changes (NMSettingsConnection *self, NMConnection *new_connection, + NMSettingsConnectionPersistMode persist_mode, NMSettingsConnectionCommitReason commit_reason, + const char *log_diff_name, GError **error) { return _update (self, new_connection, - NM_SETTINGS_CONNECTION_PERSIST_MODE_DISK, + persist_mode, commit_reason, - new_connection - ? "update-during-write" - : "replace-and-commit-disk", + log_diff_name, error); } @@ -1003,7 +1003,9 @@ nm_settings_connection_new_secrets (NMSettingsConnection *self, nm_settings_connection_commit_changes (self, NULL, + NM_SETTINGS_CONNECTION_PERSIST_MODE_DISK, NM_SETTINGS_CONNECTION_COMMIT_REASON_NONE, + "new-secrets", NULL); return TRUE; } @@ -1120,7 +1122,9 @@ get_secrets_done_cb (NMAgentManager *manager, nm_settings_connection_commit_changes (self, NULL, + NM_SETTINGS_CONNECTION_PERSIST_MODE_DISK, NM_SETTINGS_CONNECTION_COMMIT_REASON_NONE, + "get-new-secrets", NULL); } else { _LOGD ("(%s:%p) new agent secrets processed", @@ -2140,7 +2144,9 @@ dbus_clear_secrets_auth_cb (NMSettingsConnection *self, nm_settings_connection_commit_changes (self, NULL, + NM_SETTINGS_CONNECTION_PERSIST_MODE_DISK, NM_SETTINGS_CONNECTION_COMMIT_REASON_NONE, + "clear-secrets", &local); nm_audit_log_connection_op (NM_AUDIT_OP_CONN_CLEAR_SECRETS, self, diff --git a/src/settings/nm-settings-connection.h b/src/settings/nm-settings-connection.h index d4be5a5526..8306fc460a 100644 --- a/src/settings/nm-settings-connection.h +++ b/src/settings/nm-settings-connection.h @@ -131,17 +131,19 @@ gboolean nm_settings_connection_has_unmodified_applied_connection (NMSettingsCon NMConnection *applied_connection, NMSettingCompareFlags compare_flage); -gboolean nm_settings_connection_commit_changes (NMSettingsConnection *self, - NMConnection *new_connection, - NMSettingsConnectionCommitReason commit_reason, - GError **error); - typedef enum { NM_SETTINGS_CONNECTION_PERSIST_MODE_KEEP, NM_SETTINGS_CONNECTION_PERSIST_MODE_DISK, NM_SETTINGS_CONNECTION_PERSIST_MODE_IN_MEMORY, } NMSettingsConnectionPersistMode; +gboolean nm_settings_connection_commit_changes (NMSettingsConnection *self, + NMConnection *new_connection, + NMSettingsConnectionPersistMode persist_mode, + NMSettingsConnectionCommitReason commit_reason, + const char *log_diff_name, + GError **error); + gboolean nm_settings_connection_replace_settings (NMSettingsConnection *self, NMConnection *new_connection, NMSettingsConnectionPersistMode persist_mode, diff --git a/src/settings/plugins/ifupdown/nms-ifupdown-plugin.c b/src/settings/plugins/ifupdown/nms-ifupdown-plugin.c index 0928772afa..1461ea86c4 100644 --- a/src/settings/plugins/ifupdown/nms-ifupdown-plugin.c +++ b/src/settings/plugins/ifupdown/nms-ifupdown-plugin.c @@ -141,7 +141,9 @@ bind_device_to_connection (SettingsPluginIfupdown *self, nm_settings_connection_commit_changes (NM_SETTINGS_CONNECTION (exported), NULL, + NM_SETTINGS_CONNECTION_PERSIST_MODE_DISK, NM_SETTINGS_CONNECTION_COMMIT_REASON_NONE, + "ifupdown-new", NULL); }