device/trivial: rename realize/setup function in NMDevice

This commit is contained in:
Thomas Haller 2016-01-10 14:56:05 +01:00
parent 169c5b7a52
commit 633e105455
3 changed files with 19 additions and 19 deletions

View file

@ -1700,23 +1700,23 @@ link_type_compatible (NMDevice *self,
}
/**
* nm_device_realize():
* nm_device_realize_start():
* @self: the #NMDevice
* @plink: an existing platform link or %NULL
* @out_compatible: %TRUE on return if @self is compatible with @plink
* @error: location to store error, or %NULL
*
* Initializes and sets up the device using existing backing resources. Before
* the device is ready for use nm_device_setup_finish() must be called.
* the device is ready for use nm_device_realize_finish() must be called.
* @out_compatible will only be set if @plink is not %NULL, and
*
* Returns: %TRUE on success, %FALSE on error
*/
gboolean
nm_device_realize (NMDevice *self,
NMPlatformLink *plink,
gboolean *out_compatible,
GError **error)
nm_device_realize_start (NMDevice *self,
NMPlatformLink *plink,
gboolean *out_compatible,
GError **error)
{
NM_SET_OUT (out_compatible, TRUE);
@ -1771,7 +1771,7 @@ nm_device_create_and_realize (NMDevice *self,
}
realize_start_setup (self, plink);
nm_device_setup_finish (self, plink);
nm_device_realize_finish (self, plink);
g_return_val_if_fail (nm_device_check_connection_compatible (self, connection), TRUE);
return TRUE;
@ -1869,7 +1869,7 @@ realize_start_setup (NMDevice *self, const NMPlatformLink *plink)
klass = NM_DEVICE_GET_CLASS (self);
/* Balanced by a thaw in nm_device_setup_finish() */
/* Balanced by a thaw in nm_device_realize_finish() */
g_object_freeze_notify (G_OBJECT (self));
if (plink) {
@ -1949,7 +1949,7 @@ realize_start_setup (NMDevice *self, const NMPlatformLink *plink)
}
/**
* nm_device_setup_finish():
* nm_device_realize_finish():
* @self: the #NMDevice
* @plink: the #NMPlatformLink if backed by a kernel netdevice
*
@ -1958,7 +1958,7 @@ realize_start_setup (NMDevice *self, const NMPlatformLink *plink)
* is ready for network connectivity.
*/
void
nm_device_setup_finish (NMDevice *self, const NMPlatformLink *plink)
nm_device_realize_finish (NMDevice *self, const NMPlatformLink *plink)
{
g_return_if_fail (!plink || link_type_compatible (self, plink->type, NULL, NULL));

View file

@ -467,16 +467,16 @@ gboolean nm_device_get_is_nm_owned (NMDevice *device);
gboolean nm_device_has_capability (NMDevice *self, NMDeviceCapabilities caps);
gboolean nm_device_realize (NMDevice *device,
gboolean nm_device_realize_start (NMDevice *device,
NMPlatformLink *plink,
gboolean *out_compatible,
GError **error);
void nm_device_realize_finish (NMDevice *self,
const NMPlatformLink *plink);
gboolean nm_device_create_and_realize (NMDevice *self,
NMConnection *connection,
NMDevice *parent,
GError **error);
void nm_device_setup_finish (NMDevice *self,
const NMPlatformLink *plink);
gboolean nm_device_unrealize (NMDevice *device,
gboolean remove_resources,
GError **error);

View file

@ -1895,9 +1895,9 @@ factory_device_added_cb (NMDeviceFactory *factory,
{
GError *error = NULL;
if (nm_device_realize (device, NULL, NULL, &error)) {
if (nm_device_realize_start (device, NULL, NULL, &error)) {
add_device (NM_MANAGER (user_data), device, NULL);
nm_device_setup_finish (device, NULL);
nm_device_realize_finish (device, NULL);
} else {
nm_log_warn (LOGD_DEVICE, "(%s): failed to realize device: %s",
nm_device_get_iface (device), error->message);
@ -1967,9 +1967,9 @@ platform_link_added (NMManager *self,
* device with the link's name.
*/
return;
} else if (nm_device_realize (candidate, plink, &compatible, &error)) {
} else if (nm_device_realize_start (candidate, plink, &compatible, &error)) {
/* Success */
nm_device_setup_finish (candidate, plink);
nm_device_realize_finish (candidate, plink);
return;
}
@ -2016,9 +2016,9 @@ platform_link_added (NMManager *self,
if (device) {
if (nm_plugin_missing)
nm_device_set_nm_plugin_missing (device, TRUE);
if (nm_device_realize (device, plink, NULL, &error)) {
if (nm_device_realize_start (device, plink, NULL, &error)) {
add_device (self, device, NULL);
nm_device_setup_finish (device, plink);
nm_device_realize_finish (device, plink);
} else {
nm_log_warn (LOGD_DEVICE, "%s: failed to realize device: %s",
plink->name, error->message);