diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c index 70be14514..d63af3789 100644 --- a/src/settings/nm-settings-connection.c +++ b/src/settings/nm-settings-connection.c @@ -450,6 +450,7 @@ gboolean nm_settings_connection_replace_settings (NMSettingsConnection *self, NMConnection *new_connection, gboolean update_unsaved, + const char *log_diff_name, GError **error) { NMSettingsConnectionPrivate *priv; @@ -475,7 +476,8 @@ nm_settings_connection_replace_settings (NMSettingsConnection *self, */ g_signal_handlers_block_by_func (self, G_CALLBACK (changed_cb), GUINT_TO_POINTER (TRUE)); - nm_utils_log_connection_diff (new_connection, NM_CONNECTION (self), LOGL_DEBUG, LOGD_CORE, "update connection", "++ "); + if (log_diff_name) + nm_utils_log_connection_diff (new_connection, NM_CONNECTION (self), LOGL_DEBUG, LOGD_CORE, log_diff_name, "++ "); nm_connection_replace_settings_from_connection (NM_CONNECTION (self), new_connection); nm_settings_connection_set_flags (self, @@ -535,9 +537,9 @@ replace_and_commit (NMSettingsConnection *self, { GError *error = NULL; - if (nm_settings_connection_replace_settings (self, new_connection, TRUE, &error)) { + if (nm_settings_connection_replace_settings (self, new_connection, TRUE, "replace-and-commit-disk", &error)) nm_settings_connection_commit_changes (self, callback, user_data); - } else { + else { g_assert (error); if (callback) callback (self, error, user_data); @@ -1367,7 +1369,7 @@ update_auth_cb (NMSettingsConnection *self, con_update_cb, info); } else { - if (!nm_settings_connection_replace_settings (self, info->new_settings, TRUE, &local)) + if (!nm_settings_connection_replace_settings (self, info->new_settings, TRUE, "replace-and-commit-memory", &local)) g_assert (local); con_update_cb (self, local, info); g_clear_error (&local); diff --git a/src/settings/nm-settings-connection.h b/src/settings/nm-settings-connection.h index 887509721..49661f38c 100644 --- a/src/settings/nm-settings-connection.h +++ b/src/settings/nm-settings-connection.h @@ -123,6 +123,7 @@ void nm_settings_connection_commit_changes (NMSettingsConnection *connection, gboolean nm_settings_connection_replace_settings (NMSettingsConnection *self, NMConnection *new_connection, gboolean update_unsaved, + const char *log_diff_name, GError **error); void nm_settings_connection_replace_and_commit (NMSettingsConnection *self, diff --git a/src/settings/plugins/example/nm-example-connection.c b/src/settings/plugins/example/nm-example-connection.c index 2f0b20a08..e12596113 100644 --- a/src/settings/plugins/example/nm-example-connection.c +++ b/src/settings/plugins/example/nm-example-connection.c @@ -82,6 +82,7 @@ nm_example_connection_new (const char *full_path, if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (object), tmp, TRUE, + NULL, error)) { g_object_unref (object); object = NULL; diff --git a/src/settings/plugins/ibft/nm-ibft-connection.c b/src/settings/plugins/ibft/nm-ibft-connection.c index 5459a7050..c6a9054e4 100644 --- a/src/settings/plugins/ibft/nm-ibft-connection.c +++ b/src/settings/plugins/ibft/nm-ibft-connection.c @@ -46,6 +46,7 @@ nm_ibft_connection_new (const GPtrArray *block, GError **error) if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (object), source, FALSE, + NULL, error)) g_clear_object (&object); diff --git a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c index 014f69e44..9005a375f 100644 --- a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c +++ b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c @@ -235,6 +235,7 @@ nm_ifcfg_connection_new (NMConnection *source, if (nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (object), tmp, update_unsaved, + NULL, error)) nm_ifcfg_connection_check_devtimeout (NM_IFCFG_CONNECTION (object)); else diff --git a/src/settings/plugins/ifcfg-rh/plugin.c b/src/settings/plugins/ifcfg-rh/plugin.c index 458e62898..e608a29f8 100644 --- a/src/settings/plugins/ifcfg-rh/plugin.c +++ b/src/settings/plugins/ifcfg-rh/plugin.c @@ -340,6 +340,7 @@ connection_new_or_changed (SCPluginIfcfg *self, if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (existing), NM_CONNECTION (new), FALSE, /* don't set Unsaved */ + "ifcfg-rh-update", &error)) { /* Shouldn't ever get here as 'new' was verified by the reader already */ g_assert_not_reached (); diff --git a/src/settings/plugins/ifnet/nm-ifnet-connection.c b/src/settings/plugins/ifnet/nm-ifnet-connection.c index c84ad5ed9..693e65328 100644 --- a/src/settings/plugins/ifnet/nm-ifnet-connection.c +++ b/src/settings/plugins/ifnet/nm-ifnet-connection.c @@ -82,6 +82,7 @@ nm_ifnet_connection_new (NMConnection *source, const char *conn_name) nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (object), tmp, update_unsaved, + NULL, NULL); g_object_unref (tmp); diff --git a/src/settings/plugins/ifnet/plugin.c b/src/settings/plugins/ifnet/plugin.c index 37e290777..218e44aa0 100644 --- a/src/settings/plugins/ifnet/plugin.c +++ b/src/settings/plugins/ifnet/plugin.c @@ -313,6 +313,7 @@ reload_connections (NMSystemConfigInterface *config) if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (old), NM_CONNECTION (new), FALSE, /* don't set Unsaved */ + "ifnet-update", &error)) { /* Shouldn't ever get here as 'new' was verified by the reader already */ g_assert_not_reached (); diff --git a/src/settings/plugins/keyfile/nm-keyfile-connection.c b/src/settings/plugins/keyfile/nm-keyfile-connection.c index 9ff65a20a..8fb94302d 100644 --- a/src/settings/plugins/keyfile/nm-keyfile-connection.c +++ b/src/settings/plugins/keyfile/nm-keyfile-connection.c @@ -76,6 +76,7 @@ nm_keyfile_connection_new (NMConnection *source, if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (object), tmp, update_unsaved, + NULL, error)) { g_object_unref (object); object = NULL; diff --git a/src/settings/plugins/keyfile/plugin.c b/src/settings/plugins/keyfile/plugin.c index f7c9211c7..e79ad551b 100644 --- a/src/settings/plugins/keyfile/plugin.c +++ b/src/settings/plugins/keyfile/plugin.c @@ -126,6 +126,7 @@ update_connection (SCPluginKeyfile *self, if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (connection), NM_CONNECTION (tmp), FALSE, /* don't set Unsaved */ + "keyfile-update", &error)) { /* Shouldn't ever get here as 'new' was verified by the reader already */ g_assert_not_reached (); @@ -182,6 +183,7 @@ new_connection (SCPluginKeyfile *self, if (!nm_settings_connection_replace_settings (connection, NM_CONNECTION (tmp), FALSE, /* don't set Unsaved */ + "keyfile-update-new", &error)) { /* Shouldn't ever get here as 'tmp' was verified by the reader already */ g_assert_not_reached ();