device: do not remove software devices on initial disconnected (rh #1035814)

When a device is initialized to be managed, it will transition through states
unmanaged -> unavailable -> disconnected. We don't want to remove software
devices during this initial transition to disconnected, because it prevents
auto-activation.

Test case:
$ nmcli con add type vlan ifname myvlan dev eth0 id 123
NM should immediately create myvlan interface and automatically activate it.

https://bugzilla.redhat.com/show_bug.cgi?id=1035814
This commit is contained in:
Jiří Klimeš
2013-12-03 09:37:58 +01:00
parent c9c6c73166
commit d0c2a24b71

View File

@@ -4429,6 +4429,8 @@ delete_on_deactivate_check_and_schedule (NMDevice *self, int ifindex)
return;
if (nm_device_get_state (self) == NM_DEVICE_STATE_UNMANAGED)
return;
if (nm_device_get_state (self) == NM_DEVICE_STATE_UNAVAILABLE)
return;
nm_log_dbg (LOGD_DEVICE, "Schedule cleanup and delete virtual link #%d for [%s]",
ifindex, nm_device_get_iface (self));
priv = NM_DEVICE_GET_PRIVATE (self);