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.
This commit is contained in:
Thomas Haller 2016-01-10 14:48:13 +01:00
parent eee00a8355
commit 169c5b7a52
2 changed files with 0 additions and 27 deletions

View file

@ -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;

View file

@ -144,27 +144,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