summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2016-07-23 09:02:17 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2016-07-23 09:02:17 +0200
commitc44b13f87c21a75c701d1e54d2bb4abe48084ab4 (patch)
treeeee3893dd6897dee45f4614eaaea459111d4e08f
parent1fbdd4d008eb671c05c5541b4b641c9de38fb863 (diff)
parent300b8ce842710fd731f46d5bf1964473a8f50550 (diff)
downloadNetworkManager-c44b13f87c21a75c701d1e54d2bb4abe48084ab4.tar.gz
team: merge branch 'bg/team-conf-expose-rh1310435-v2'
Some fixes for the the loading of JSON team config from teamd. https://bugzilla.redhat.com/show_bug.cgi?id=1310435
-rw-r--r--src/devices/team/nm-device-team.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c
index 6d2560493f..d32d3cc9b0 100644
--- a/src/devices/team/nm-device-team.c
+++ b/src/devices/team/nm-device-team.c
@@ -54,6 +54,7 @@ typedef struct {
GPid teamd_pid;
guint teamd_process_watch;
guint teamd_timeout;
+ guint teamd_read_timeout;
guint teamd_dbus_watch;
char *config;
} NMDeviceTeamPrivate;
@@ -161,7 +162,7 @@ teamd_read_config (NMDevice *device)
int err;
if (priv->tdc) {
- err = teamdctl_config_get_raw_direct (priv->tdc, &config);
+ err = teamdctl_config_actual_get_raw_direct (priv->tdc, &config);
if (err)
return FALSE;
}
@@ -175,6 +176,17 @@ teamd_read_config (NMDevice *device)
return TRUE;
}
+static gboolean
+teamd_read_timeout_cb (gpointer user_data)
+{
+ NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (user_data);
+
+ teamd_read_config ((NMDevice *) user_data);
+ priv->teamd_read_timeout = 0;
+
+ return G_SOURCE_REMOVE;
+}
+
static void
update_connection (NMDevice *device, NMConnection *connection)
{
@@ -278,6 +290,7 @@ teamd_cleanup (NMDevice *device, gboolean free_tdc)
nm_clear_g_source (&priv->teamd_process_watch);
nm_clear_g_source (&priv->teamd_timeout);
+ nm_clear_g_source (&priv->teamd_read_timeout);
if (priv->teamd_pid > 0) {
nm_utils_kill_child_async (priv->teamd_pid, SIGTERM, LOGD_TEAM, "teamd", 2000, NULL, NULL);
@@ -665,6 +678,11 @@ enslave_slave (NMDevice *device,
if (!success)
return FALSE;
+ nm_clear_g_source (&priv->teamd_read_timeout);
+ priv->teamd_read_timeout = g_timeout_add_seconds (5,
+ teamd_read_timeout_cb,
+ self);
+
_LOGI (LOGD_TEAM, "enslaved team port %s", slave_iface);
} else
_LOGI (LOGD_TEAM, "team port %s was enslaved", slave_iface);
@@ -678,6 +696,7 @@ release_slave (NMDevice *device,
gboolean configure)
{
NMDeviceTeam *self = NM_DEVICE_TEAM (device);
+ NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (device);
gboolean success, no_firmware = FALSE;
if (configure) {
@@ -697,6 +716,11 @@ release_slave (NMDevice *device,
if (!nm_device_bring_up (slave, TRUE, &no_firmware))
_LOGW (LOGD_TEAM, "released team port %s could not be brought up",
nm_device_get_ip_iface (slave));
+
+ nm_clear_g_source (&priv->teamd_read_timeout);
+ priv->teamd_read_timeout = g_timeout_add_seconds (5,
+ teamd_read_timeout_cb,
+ self);
} else
_LOGI (LOGD_TEAM, "team port %s was released", nm_device_get_ip_iface (slave));
}