mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-02 15:50:13 +01:00
core: add "reason" argument to NMActiveConnection device_state_changed()
NMActiveConnection implements method device_state_changed() that
re-emits device state changes as convenience for subclasses. Add the
reason for the state change to the handler, as it will be used in the
next commit.
(cherry picked from commit 634dd2f5e8)
This commit is contained in:
parent
366ea0bf32
commit
526a001852
4 changed files with 8 additions and 4 deletions
|
|
@ -259,7 +259,8 @@ static void
|
|||
device_state_changed(NMActiveConnection *active,
|
||||
NMDevice *device,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state)
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason)
|
||||
{
|
||||
NMActiveConnectionState cur_ac_state = nm_active_connection_get_state(active);
|
||||
NMActiveConnectionState ac_state = NM_ACTIVE_CONNECTION_STATE_UNKNOWN;
|
||||
|
|
|
|||
|
|
@ -636,7 +636,8 @@ device_state_changed(NMDevice *device,
|
|||
NM_ACTIVE_CONNECTION_GET_CLASS(self)->device_state_changed(self,
|
||||
device,
|
||||
new_state,
|
||||
old_state);
|
||||
old_state,
|
||||
reason);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -78,7 +78,8 @@ typedef struct {
|
|||
void (*device_state_changed)(NMActiveConnection *connection,
|
||||
NMDevice *device,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state);
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason);
|
||||
void (*master_failed)(NMActiveConnection *connection);
|
||||
|
||||
void (*device_changed)(NMActiveConnection *connection,
|
||||
|
|
|
|||
|
|
@ -1143,7 +1143,8 @@ static void
|
|||
device_state_changed(NMActiveConnection *active,
|
||||
NMDevice *device,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state)
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason)
|
||||
{
|
||||
if (_service_and_connection_can_persist(NM_VPN_CONNECTION(active))) {
|
||||
if (new_state <= NM_DEVICE_STATE_DISCONNECTED || new_state == NM_DEVICE_STATE_FAILED) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue