mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-07 20:40:21 +01:00
settings: unify settings-update API (nm_settings_connection_replace_settings())
This commit is contained in:
parent
1425be0397
commit
9a4225ac96
9 changed files with 10 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue