From 85651fa52e64261e154e98df9365a2b0ed1f2af6 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 26 Sep 2019 13:36:41 +0200 Subject: core: log why no "auto-default" connection was created Add trace logging to aid debugging. --- src/settings/nm-settings.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index fdd5835c59..61f9eccc87 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -3431,14 +3431,27 @@ device_realized (NMDevice *device, GParamSpec *pspec, NMSettings *self) */ if ( !NM_DEVICE_GET_CLASS (self)->new_default_connection || !nm_device_get_managed (device, FALSE) - || g_object_get_qdata (G_OBJECT (device), _default_wired_connection_quark ()) - || have_connection_for_device (self, device) - || nm_config_get_no_auto_default_for_device (priv->config, device)) + || g_object_get_qdata (G_OBJECT (device), _default_wired_connection_quark ())) return; + if (nm_config_get_no_auto_default_for_device (priv->config, device)) { + _LOGT ("auto-default: cannot create auto-default connection for device %s: disabled by \"no-auto-default\"", + nm_device_get_iface (device)); + return; + } + + if (have_connection_for_device (self, device)) { + _LOGT ("auto-default: cannot create auto-default connection for device %s: already has a profile", + nm_device_get_iface (device)); + return; + } + connection = nm_device_new_default_connection (device); - if (!connection) + if (!connection) { + _LOGT ("auto-default: cannot create auto-default connection for device %s", + nm_device_get_iface (device)); return; + } _LOGT ("auto-default: creating in-memory connection %s (%s) for device %s", nm_connection_get_uuid (connection), -- cgit v1.2.1