mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-04 21:08:04 +02:00
core/team: fold teamd_gone() into teamd_dbus_appeared()
No need for it to be separate now that the "usock" interface is gone.
This commit is contained in:
parent
4c08edaab6
commit
b1162f444a
1 changed files with 15 additions and 22 deletions
|
|
@ -378,25 +378,6 @@ teamd_dbus_timeout_cb(gpointer user_data)
|
|||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
teamd_gone(NMDeviceTeam *self)
|
||||
{
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceState state;
|
||||
|
||||
teamd_cleanup(self, TRUE);
|
||||
state = nm_device_get_state(device);
|
||||
|
||||
/* Attempt to respawn teamd */
|
||||
if (state >= NM_DEVICE_STATE_PREPARE && state <= NM_DEVICE_STATE_ACTIVATED) {
|
||||
if (!teamd_start(self)) {
|
||||
nm_device_state_changed(device,
|
||||
NM_DEVICE_STATE_FAILED,
|
||||
NM_DEVICE_STATE_REASON_TEAMD_CONTROL_FAILED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
teamd_dbus_appeared(GDBusConnection *connection,
|
||||
const char *name,
|
||||
|
|
@ -488,8 +469,10 @@ teamd_dbus_appeared(GDBusConnection *connection,
|
|||
static void
|
||||
teamd_dbus_vanished(GDBusConnection *dbus_connection, const char *name, gpointer user_data)
|
||||
{
|
||||
NMDeviceTeam *self = NM_DEVICE_TEAM(user_data);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
NMDeviceTeam *self = NM_DEVICE_TEAM(user_data);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceState state;
|
||||
|
||||
g_return_if_fail(priv->teamd_dbus_watch);
|
||||
|
||||
|
|
@ -504,7 +487,17 @@ teamd_dbus_vanished(GDBusConnection *dbus_connection, const char *name, gpointer
|
|||
|
||||
_LOGI(LOGD_TEAM, "teamd vanished from D-Bus");
|
||||
|
||||
teamd_gone(self);
|
||||
teamd_cleanup(self, TRUE);
|
||||
state = nm_device_get_state(device);
|
||||
|
||||
/* Attempt to respawn teamd */
|
||||
if (state >= NM_DEVICE_STATE_PREPARE && state <= NM_DEVICE_STATE_ACTIVATED) {
|
||||
if (!teamd_start(self)) {
|
||||
nm_device_state_changed(device,
|
||||
NM_DEVICE_STATE_FAILED,
|
||||
NM_DEVICE_STATE_REASON_TEAMD_CONTROL_FAILED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue