From 69f92cfa2cd9cce65c4cb6d702bb458595afd69e Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 17 Dec 2013 14:24:39 -0500 Subject: [PATCH] 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.) --- src/nm-manager.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 875464eb8d..babc051741 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -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. */