mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 04:10:14 +01:00
manager: use nm_active_connection_set_state_fail() instead of _internal_activation_failed()
There is a small change in behavior: Previously, the DEACTIVATING/DEACTIVATED states were set if and only if the previous state was less or equal then ACTIVATED. For example, if the state was already DEACTIVATING, it would have done nothing. Now, nm_active_connection_set_state_fail() transitions the states depending on the previous state. E.g. it would only set DEACTIVATING state, if the previous state was ACTIVATING/ACTIVATED. On the other hand, it would always progress the state to DEACTIVATED. The new behavior makes more sense to me, although I doubt that there is a visible difference.
This commit is contained in:
parent
c027fc5d82
commit
c5a97ad265
1 changed files with 10 additions and 23 deletions
|
|
@ -3941,25 +3941,6 @@ _new_active_connection (NMManager *self,
|
|||
device);
|
||||
}
|
||||
|
||||
static void
|
||||
_internal_activation_failed (NMManager *self,
|
||||
NMActiveConnection *active,
|
||||
const char *error_desc)
|
||||
{
|
||||
_LOGD (LOGD_CORE, "Failed to activate '%s': %s",
|
||||
nm_active_connection_get_settings_connection_id (active),
|
||||
error_desc);
|
||||
|
||||
if (nm_active_connection_get_state (active) <= NM_ACTIVE_CONNECTION_STATE_ACTIVATED) {
|
||||
nm_active_connection_set_state (active,
|
||||
NM_ACTIVE_CONNECTION_STATE_DEACTIVATING,
|
||||
NM_ACTIVE_CONNECTION_STATE_REASON_UNKNOWN);
|
||||
nm_active_connection_set_state (active,
|
||||
NM_ACTIVE_CONNECTION_STATE_DEACTIVATED,
|
||||
NM_ACTIVE_CONNECTION_STATE_REASON_UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_internal_activation_auth_done (NMActiveConnection *active,
|
||||
gboolean success,
|
||||
|
|
@ -4005,7 +3986,9 @@ _internal_activation_auth_done (NMActiveConnection *active,
|
|||
}
|
||||
|
||||
nm_assert (error_desc || error);
|
||||
_internal_activation_failed (self, active, error_desc ? error_desc : error->message);
|
||||
nm_active_connection_set_state_fail (active,
|
||||
NM_ACTIVE_CONNECTION_STATE_REASON_UNKNOWN,
|
||||
error_desc ?: error->message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -4249,7 +4232,9 @@ _activation_auth_done (NMActiveConnection *active,
|
|||
|
||||
nm_audit_log_connection_op (NM_AUDIT_OP_CONN_ACTIVATE, connection, FALSE, NULL,
|
||||
subject, error->message);
|
||||
_internal_activation_failed (self, active, error->message);
|
||||
nm_active_connection_set_state_fail (active,
|
||||
NM_ACTIVE_CONNECTION_STATE_REASON_UNKNOWN,
|
||||
error->message);
|
||||
|
||||
g_dbus_method_invocation_take_error (context, error);
|
||||
}
|
||||
|
|
@ -4398,8 +4383,10 @@ activation_add_done (NMSettings *settings,
|
|||
error = local;
|
||||
}
|
||||
|
||||
g_assert (error);
|
||||
_internal_activation_failed (self, active, error->message);
|
||||
nm_assert (error);
|
||||
nm_active_connection_set_state_fail (active,
|
||||
NM_ACTIVE_CONNECTION_STATE_REASON_UNKNOWN,
|
||||
error->message);
|
||||
if (new_connection)
|
||||
nm_settings_connection_delete (new_connection, NULL);
|
||||
g_dbus_method_invocation_return_gerror (context, error);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue