From 2905999cd9342c339ba67cc34be9dea352cacc55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 11 Jun 2014 12:38:07 +0200 Subject: [PATCH] team: start teamd when ensuring team connection else teamdctl_connect() fails Check if teamd is already running before trying to connect, else it would fail anyway with errors: libteamdctl: teamdctl_connect: Failed to connect using all CLIs. NetworkManager[5535]: [1402495644.226625] [devices/nm-device-team.c:208] ensure_teamd_connection(): (TTT): failed to connect to teamd (err=-22) # ip link set name TTT type team (cherry picked from commit a78386b6d1a3d62063aa039d4ee9eba77c04a284) --- src/devices/nm-device-team.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/devices/nm-device-team.c b/src/devices/nm-device-team.c index 0b9a621a46..f3b25e3b1d 100644 --- a/src/devices/nm-device-team.c +++ b/src/devices/nm-device-team.c @@ -53,6 +53,8 @@ G_DEFINE_TYPE (NMDeviceTeam, nm_device_team, NM_TYPE_DEVICE) #define NM_TEAM_ERROR (nm_team_error_quark ()) +static gboolean teamd_start (NMDevice *dev, NMSettingTeam *s_team); + typedef struct { #if WITH_TEAMDCTL struct teamdctl *tdc; @@ -226,7 +228,8 @@ update_connection (NMDevice *device, NMConnection *connection) g_object_set (G_OBJECT (s_team), NM_SETTING_TEAM_CONFIG, NULL, NULL); #if WITH_TEAMDCTL - if (ensure_teamd_connection (device)) { + teamd_start (device, s_team); + if (NM_DEVICE_TEAM_GET_PRIVATE (device)->teamd_pid > 0 && ensure_teamd_connection (device)) { const char *config = NULL; int err; @@ -503,9 +506,8 @@ teamd_start (NMDevice *dev, NMSettingTeam *s_team) #endif priv->teamd_timeout) { - /* FIXME g_assert that this never hits. For now, be more reluctant, and try to recover. */ - g_warn_if_reached (); - teamd_cleanup (dev, FALSE); + /* Just return if teamd_start() was already called */ + return TRUE; } teamd_binary = teamd_paths;