From ad497301d015664c2a7bf782c2f735e8c4ced50a Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 11 Oct 2022 13:44:31 +0200 Subject: [PATCH] team: don't log failures to connect to teamd on error level ensure_teamd_connection() is called from multiple spots. Sometimes we call opportunistically without having started teamd (e.g. when on update_connection() when generating a connection for teaming device that was created) and handle the failure to connect gracefully. Let's not pollute the logs with things on ERROR level that are not actually serious. Demote the logging statement to DEBUG and log an ERROR only when we expect ensure_teamd_connection() to actually succeed. --- src/core/devices/team/nm-device-team.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/devices/team/nm-device-team.c b/src/core/devices/team/nm-device-team.c index 49ce953df1..9103bfb97f 100644 --- a/src/core/devices/team/nm-device-team.c +++ b/src/core/devices/team/nm-device-team.c @@ -168,7 +168,7 @@ ensure_teamd_connection(NMDevice *device) priv->tdc = _tdc_connect_new(self, nm_device_get_iface(device), &error); if (!priv->tdc) { - _LOGE(LOGD_TEAM, "failed to connect to teamd: %s", error->message); + _LOGD(LOGD_TEAM, "failed to connect to teamd: %s", error->message); return FALSE; } @@ -412,6 +412,8 @@ teamd_ready(NMDeviceTeam *self) * device activation. */ success = ensure_teamd_connection(device); + if (!success) + _LOGE(LOGD_TEAM, "Could not connect to teamd"); if (nm_device_get_state(device) != NM_DEVICE_STATE_PREPARE || priv->stage1_state != NM_DEVICE_STAGE_STATE_PENDING)