mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-15 05:40:31 +01:00
device/trivial: rename master related function of nm-device
We have the master/slave related functions
- for master device:
- nm_device_master_add_slave()
- nm_device_master_release_slaves()
- nm_device_release_one_slave()
- nm_device_enslave_slave()
- for slave device:
- nm_device_slave_notify_enslave()
- nm_device_slave_notify_release()
Rename the two that didn't match the pattern to
- nm_device_master_release_one_slave()
- nm_device_master_enslave_slave()
This commit is contained in:
parent
b9f31f326c
commit
a39dc1cd4b
1 changed files with 11 additions and 12 deletions
|
|
@ -1035,7 +1035,7 @@ free_slave_info (SlaveInfo *info)
|
|||
}
|
||||
|
||||
/**
|
||||
* nm_device_enslave_slave:
|
||||
* nm_device_master_enslave_slave:
|
||||
* @self: the master device
|
||||
* @slave: the slave device to enslave
|
||||
* @connection: (allow-none): the slave device's connection
|
||||
|
|
@ -1047,7 +1047,7 @@ free_slave_info (SlaveInfo *info)
|
|||
* other devices.
|
||||
*/
|
||||
static gboolean
|
||||
nm_device_enslave_slave (NMDevice *self, NMDevice *slave, NMConnection *connection)
|
||||
nm_device_master_enslave_slave (NMDevice *self, NMDevice *slave, NMConnection *connection)
|
||||
{
|
||||
SlaveInfo *info;
|
||||
gboolean success = FALSE;
|
||||
|
|
@ -1095,7 +1095,7 @@ nm_device_enslave_slave (NMDevice *self, NMDevice *slave, NMConnection *connecti
|
|||
}
|
||||
|
||||
/**
|
||||
* nm_device_release_one_slave:
|
||||
* nm_device_master_release_one_slave:
|
||||
* @self: the master device
|
||||
* @slave: the slave device to release
|
||||
* @configure: whether @self needs to actually release @slave
|
||||
|
|
@ -1109,7 +1109,7 @@ nm_device_enslave_slave (NMDevice *self, NMDevice *slave, NMConnection *connecti
|
|||
* other devices, or if @slave was never enslaved.
|
||||
*/
|
||||
static gboolean
|
||||
nm_device_release_one_slave (NMDevice *self, NMDevice *slave, gboolean configure, NMDeviceStateReason reason)
|
||||
nm_device_master_release_one_slave (NMDevice *self, NMDevice *slave, gboolean configure, NMDeviceStateReason reason)
|
||||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
||||
SlaveInfo *info;
|
||||
|
|
@ -1177,7 +1177,7 @@ nm_device_finish_init (NMDevice *self)
|
|||
nm_device_set_unmanaged_flags_initial (self, NM_UNMANAGED_EXTERNAL_DOWN, TRUE);
|
||||
|
||||
if (priv->master)
|
||||
nm_device_enslave_slave (priv->master, self, NULL);
|
||||
nm_device_master_enslave_slave (priv->master, self, NULL);
|
||||
|
||||
if (priv->ifindex > 0) {
|
||||
if (priv->ifindex == 1) {
|
||||
|
|
@ -1391,7 +1391,7 @@ device_recheck_slave_status (NMDevice *self, NMPlatformLink *plink)
|
|||
g_return_if_fail (plink != NULL);
|
||||
|
||||
if (priv->is_enslaved && plink->master != nm_device_get_ifindex (priv->master))
|
||||
nm_device_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
|
||||
nm_device_master_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
|
||||
|
||||
if (plink->master && !priv->is_enslaved) {
|
||||
NMDevice *master;
|
||||
|
|
@ -2129,7 +2129,7 @@ slave_state_changed (NMDevice *slave,
|
|||
return;
|
||||
|
||||
if (slave_new_state == NM_DEVICE_STATE_IP_CONFIG)
|
||||
nm_device_enslave_slave (self, slave, nm_device_get_applied_connection (slave));
|
||||
nm_device_master_enslave_slave (self, slave, nm_device_get_applied_connection (slave));
|
||||
else if (slave_new_state > NM_DEVICE_STATE_ACTIVATED)
|
||||
release = TRUE;
|
||||
else if ( slave_new_state <= NM_DEVICE_STATE_DISCONNECTED
|
||||
|
|
@ -2139,7 +2139,7 @@ slave_state_changed (NMDevice *slave,
|
|||
}
|
||||
|
||||
if (release) {
|
||||
nm_device_release_one_slave (self, slave, TRUE, reason);
|
||||
nm_device_master_release_one_slave (self, slave, TRUE, reason);
|
||||
/* Bridge/bond/team interfaces are left up until manually deactivated */
|
||||
if (priv->slaves == NULL && priv->state == NM_DEVICE_STATE_ACTIVATED)
|
||||
_LOGD (LOGD_DEVICE, "last slave removed; remaining activated");
|
||||
|
|
@ -2285,7 +2285,7 @@ nm_device_master_release_slaves (NMDevice *self)
|
|||
while (priv->slaves) {
|
||||
SlaveInfo *info = priv->slaves->data;
|
||||
|
||||
nm_device_release_one_slave (self, info->slave, TRUE, reason);
|
||||
nm_device_master_release_one_slave (self, info->slave, TRUE, reason);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2439,11 +2439,10 @@ nm_device_removed (NMDevice *self)
|
|||
if (priv->is_enslaved) {
|
||||
/* this is called when something externally messes with the slave or during shut-down.
|
||||
* Release the slave from master, but don't touch the device. */
|
||||
nm_device_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
|
||||
nm_device_master_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
is_available (NMDevice *self, NMDeviceCheckDevAvailableFlags flags)
|
||||
{
|
||||
|
|
@ -3404,7 +3403,7 @@ activate_stage2_device_config (NMDevice *self)
|
|||
NMDeviceState slave_state = nm_device_get_state (info->slave);
|
||||
|
||||
if (slave_state == NM_DEVICE_STATE_IP_CONFIG)
|
||||
nm_device_enslave_slave (self, info->slave, nm_device_get_applied_connection (info->slave));
|
||||
nm_device_master_enslave_slave (self, info->slave, nm_device_get_applied_connection (info->slave));
|
||||
else if ( nm_device_uses_generated_assumed_connection (self)
|
||||
&& slave_state <= NM_DEVICE_STATE_DISCONNECTED)
|
||||
nm_device_queue_recheck_assume (info->slave);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue