vlan: don't fail if parent isn't found at construct time for existing devices
authorDan Williams <dcbw@redhat.com>
Mon, 13 Apr 2015 16:43:12 +0000 (11:43 -0500)
committerDan Williams <dcbw@redhat.com>
Wed, 6 May 2015 21:14:24 +0000 (16:14 -0500)
commitcd3df12c8f8ed6c868c12bc4e7fe6ba162dafc5b
treea0d645ff29c22751bdbd9ded69f3f520a92dd2f8
parent477cbc848af27f0eccf59092873d75e5a50552c1
vlan: don't fail if parent isn't found at construct time for existing devices

For existing devices, depending on the order that netlink sends interfaces to
us, the parent may be found after the VLAN interface and not be available when
the VLAN interface is constructed.  Instead of failing construction, when a
NMDeviceVlan has no parent keep it unavailable for activation.  Then have
the Manager notify existing devices when a new device is found, and let
NMDeviceVlan find the parent later and become available via that mechanism.

This doesn't apply to VLANs created by NM itself, because the kernel requires
a parent ifindex when creating a VLAN device.  Thus this fix only applies to
VLANs created outside NetworkManager, or existing when NM starts up.
introspection/nm-device.xml
libnm-core/nm-dbus-interface.h
libnm-util/NetworkManager.h
src/devices/nm-device-vlan.c
src/devices/nm-device.h
src/nm-manager.c