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:
@@ -3575,13 +3575,16 @@ do_sleep_wake (NMManager *self)
|
|||||||
if (manager_sleeping (self)) {
|
if (manager_sleeping (self)) {
|
||||||
nm_log_info (LOGD_SUSPEND, "sleeping or disabling...");
|
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
|
* to keep things fast the device list will get resynced when
|
||||||
* the manager wakes up.
|
* the manager wakes up.
|
||||||
*/
|
*/
|
||||||
for (iter = priv->devices; iter; iter = iter->next)
|
for (iter = priv->devices; iter; iter = iter->next) {
|
||||||
nm_device_set_manager_managed (NM_DEVICE (iter->data), FALSE, NM_DEVICE_STATE_REASON_SLEEPING);
|
NMDevice *device = iter->data;
|
||||||
|
|
||||||
|
if (!nm_device_is_software (device))
|
||||||
|
nm_device_set_manager_managed (device, FALSE, NM_DEVICE_STATE_REASON_SLEEPING);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
nm_log_info (LOGD_SUSPEND, "waking up and re-enabling...");
|
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);
|
NMDevice *device = NM_DEVICE (iter->data);
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
|
if (nm_device_is_software (device))
|
||||||
|
continue;
|
||||||
|
|
||||||
/* enable/disable wireless devices since that we don't respond
|
/* enable/disable wireless devices since that we don't respond
|
||||||
* to killswitch changes during sleep.
|
* to killswitch changes during sleep.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user