diff options
author | Thomas Haller <thaller@redhat.com> | 2016-01-10 14:48:13 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-01-11 12:22:19 +0100 |
commit | 01ede9ae5d4e6c78e3328d0d80d663467146557f (patch) | |
tree | bd2527c8e7623aafb54947dbf453f9c47ae8791b | |
parent | 493011428aa860a3b931f948d70339ba36f54d89 (diff) | |
download | NetworkManager-01ede9ae5d4e6c78e3328d0d80d663467146557f.tar.gz |
device: remove unused virtual function NMDevice:realize()
The idea of NMDevice:realize() was to
(1) update the device properties
(2) fail realization if some critical properties are missing
(1) is already done during nm_device_setup_start().
(2) was only implemented by NMDeviceVlan:realize(), but it
basically was just checking whether such a platform device exists.
Other implementations don't do that either and it opens up for a race
when the device gets deleted externally.
-rw-r--r-- | src/devices/nm-device.c | 6 | ||||
-rw-r--r-- | src/devices/nm-device.h | 21 |
2 files changed, 0 insertions, 27 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 86ac069fa0..4c05383353 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -1732,12 +1732,6 @@ nm_device_realize (NMDevice *self, return FALSE; } - /* Try to realize the device from existing resources */ - if (NM_DEVICE_GET_CLASS (self)->realize) { - if (!NM_DEVICE_GET_CLASS (self)->realize (self, plink, error)) - return FALSE; - } - realize_start_setup (self, plink); return TRUE; diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h index edcbb443a1..6b004a48ca 100644 --- a/src/devices/nm-device.h +++ b/src/devices/nm-device.h @@ -145,27 +145,6 @@ typedef struct { void (* link_changed) (NMDevice *self, NMPlatformLink *info); /** - * realize(): - * @self: the #NMDevice - * @plink: the #NMPlatformLink if backed by a kernel netdevice - * @error: location to store error, or %NULL - * - * Realize the device from existing backing resources. No resources - * should be created as a side-effect of this function. This function - * should only fail if critical device properties/resources (eg, VLAN ID) - * fail to be read or initialized, that would cause the device to be - * unusable. For example, for any properties required to realize the device - * during create_and_realize(), if reading those properties in realize() - * should fail, this function should probably return %FALSE and an error. - * - * Returns: %TRUE on success, %FALSE if some error ocurred when realizing - * the device from backing resources - */ - gboolean (*realize) (NMDevice *self, - NMPlatformLink *plink, - GError **error); - - /** * create_and_realize(): * @self: the #NMDevice * @connection: the #NMConnection being activated |