settings: unify settings-update API (nm_settings_connection_replace_settings())

This commit is contained in:
Thomas Haller 2017-12-01 10:09:43 +01:00
parent 1425be0397
commit 9a4225ac96
9 changed files with 10 additions and 1 deletions

View file

@ -716,13 +716,14 @@ gboolean
nm_settings_connection_replace_settings (NMSettingsConnection *self,
NMConnection *new_connection,
NMSettingsConnectionPersistMode persist_mode,
NMSettingsConnectionCommitReason commit_reason,
const char *log_diff_name,
GError **error)
{
return _update (self,
new_connection,
persist_mode,
NM_SETTINGS_CONNECTION_COMMIT_REASON_NONE,
commit_reason,
log_diff_name,
error);
}

View file

@ -147,6 +147,7 @@ gboolean nm_settings_connection_commit_changes (NMSettingsConnection *self,
gboolean nm_settings_connection_replace_settings (NMSettingsConnection *self,
NMConnection *new_connection,
NMSettingsConnectionPersistMode persist_mode,
NMSettingsConnectionCommitReason commit_reason,
const char *log_diff_name,
GError **error);

View file

@ -63,6 +63,7 @@ nms_ibft_connection_new (const GPtrArray *block, GError **error)
if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (object),
source,
NM_SETTINGS_CONNECTION_PERSIST_MODE_KEEP,
NM_SETTINGS_CONNECTION_COMMIT_REASON_NONE,
NULL,
error))
g_clear_object (&object);

View file

@ -463,6 +463,7 @@ nm_ifcfg_connection_new (NMConnection *source,
full_path
? NM_SETTINGS_CONNECTION_PERSIST_MODE_KEEP /* connection is already on disk */
: NM_SETTINGS_CONNECTION_PERSIST_MODE_IN_MEMORY,
NM_SETTINGS_CONNECTION_COMMIT_REASON_NONE,
NULL,
error))
nm_ifcfg_connection_check_devtimeout (NM_IFCFG_CONNECTION (object));

View file

@ -316,6 +316,7 @@ update_connection (SettingsPluginIfcfg *self,
if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (connection_by_uuid),
NM_CONNECTION (connection_new),
NM_SETTINGS_CONNECTION_PERSIST_MODE_KEEP,
NM_SETTINGS_CONNECTION_COMMIT_REASON_NONE,
"ifcfg-update",
&local)) {
/* Shouldn't ever get here as 'connection_new' was verified by the reader already

View file

@ -191,6 +191,7 @@ nm_ifnet_connection_new (NMConnection *source, const char *conn_name)
update_unsaved
? NM_SETTINGS_CONNECTION_PERSIST_MODE_IN_MEMORY
: NM_SETTINGS_CONNECTION_PERSIST_MODE_KEEP,
NM_SETTINGS_CONNECTION_COMMIT_REASON_NONE,
NULL,
NULL)) {
g_object_unref (object);

View file

@ -272,6 +272,7 @@ reload_connections (NMSettingsPlugin *config)
if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (old),
NM_CONNECTION (new),
NM_SETTINGS_CONNECTION_PERSIST_MODE_KEEP,
NM_SETTINGS_CONNECTION_COMMIT_REASON_NONE,
"ifnet-update",
&error)) {
/* Shouldn't ever get here as 'new' was verified by the reader already

View file

@ -164,6 +164,7 @@ nms_keyfile_connection_new (NMConnection *source,
update_unsaved
? NM_SETTINGS_CONNECTION_PERSIST_MODE_IN_MEMORY
: NM_SETTINGS_CONNECTION_PERSIST_MODE_KEEP,
NM_SETTINGS_CONNECTION_COMMIT_REASON_NONE,
NULL,
error)) {
g_object_unref (object);

View file

@ -261,6 +261,7 @@ update_connection (NMSKeyfilePlugin *self,
if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (connection_by_uuid),
NM_CONNECTION (connection_new),
NM_SETTINGS_CONNECTION_PERSIST_MODE_KEEP,
NM_SETTINGS_CONNECTION_COMMIT_REASON_NONE,
"keyfile-update",
&local)) {
/* Shouldn't ever get here as 'connection_new' was verified by the reader already