mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-24 20:40:06 +01:00
core: when suspending, don't take down virtual devices (rh #1038158)
NM bounces devices on suspend/resume, since some buggy drivers require it. However, there's no need to take down virtual devices. (In particular, we don't want to take down libvirt's virbr0, since it won't get automatically brought back up afterward.)
This commit is contained in:
parent
6b3c209d9a
commit
69f92cfa2c
1 changed files with 9 additions and 3 deletions
|
|
@ -3575,13 +3575,16 @@ do_sleep_wake (NMManager *self)
|
|||
if (manager_sleeping (self)) {
|
||||
nm_log_info (LOGD_SUSPEND, "sleeping or disabling...");
|
||||
|
||||
/* Just deactivate and down all devices from the device list,
|
||||
/* Just deactivate and down all physical devices from the device list,
|
||||
* to keep things fast the device list will get resynced when
|
||||
* the manager wakes up.
|
||||
*/
|
||||
for (iter = priv->devices; iter; iter = iter->next)
|
||||
nm_device_set_manager_managed (NM_DEVICE (iter->data), FALSE, NM_DEVICE_STATE_REASON_SLEEPING);
|
||||
for (iter = priv->devices; iter; iter = iter->next) {
|
||||
NMDevice *device = iter->data;
|
||||
|
||||
if (!nm_device_is_software (device))
|
||||
nm_device_set_manager_managed (device, FALSE, NM_DEVICE_STATE_REASON_SLEEPING);
|
||||
}
|
||||
} else {
|
||||
nm_log_info (LOGD_SUSPEND, "waking up and re-enabling...");
|
||||
|
||||
|
|
@ -3597,6 +3600,9 @@ do_sleep_wake (NMManager *self)
|
|||
NMDevice *device = NM_DEVICE (iter->data);
|
||||
guint i;
|
||||
|
||||
if (nm_device_is_software (device))
|
||||
continue;
|
||||
|
||||
/* enable/disable wireless devices since that we don't respond
|
||||
* to killswitch changes during sleep.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue