mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-06 17:14:02 +00:00
core: rename nm_config_data_get_device_config_*() variants
The fully generic way to lookup a device config is using the NMMatchSpecDeviceData. Rename the accessors that operate on a NMDevice instead.
This commit is contained in:
parent
5251806651
commit
ac7b6e532f
|
@ -7520,7 +7520,8 @@ device_init_static_sriov_num_vfs(NMDevice *self)
|
|||
if (priv->ifindex > 0 && nm_device_has_capability(self, NM_DEVICE_CAP_SRIOV)) {
|
||||
int num_vfs;
|
||||
|
||||
num_vfs = nm_config_data_get_device_config_int64(NM_CONFIG_GET_DATA,
|
||||
num_vfs = nm_config_data_get_device_config_int64_by_device(
|
||||
NM_CONFIG_GET_DATA,
|
||||
NM_CONFIG_KEYFILE_KEY_DEVICE_SRIOV_NUM_VFS,
|
||||
self,
|
||||
10,
|
||||
|
@ -14317,7 +14318,8 @@ nm_device_is_up(NMDevice *self)
|
|||
static gint64
|
||||
_get_carrier_wait_ms(NMDevice *self)
|
||||
{
|
||||
return nm_config_data_get_device_config_int64(NM_CONFIG_GET_DATA,
|
||||
return nm_config_data_get_device_config_int64_by_device(
|
||||
NM_CONFIG_GET_DATA,
|
||||
NM_CONFIG_KEYFILE_KEY_DEVICE_CARRIER_WAIT_TIMEOUT,
|
||||
self,
|
||||
10,
|
||||
|
@ -14881,7 +14883,7 @@ nm_device_check_unrealized_device_managed(NMDevice *self)
|
|||
|
||||
nm_assert(!nm_device_is_real(self));
|
||||
|
||||
if (!nm_config_data_get_device_config_boolean(NM_CONFIG_GET_DATA,
|
||||
if (!nm_config_data_get_device_config_boolean_by_device(NM_CONFIG_GET_DATA,
|
||||
NM_CONFIG_KEYFILE_KEY_DEVICE_MANAGED,
|
||||
self,
|
||||
TRUE,
|
||||
|
@ -14952,7 +14954,7 @@ nm_device_set_unmanaged_by_user_conf(NMDevice *self)
|
|||
gboolean value;
|
||||
NMUnmanFlagOp set_op;
|
||||
|
||||
value = nm_config_data_get_device_config_boolean(NM_CONFIG_GET_DATA,
|
||||
value = nm_config_data_get_device_config_boolean_by_device(NM_CONFIG_GET_DATA,
|
||||
NM_CONFIG_KEYFILE_KEY_DEVICE_MANAGED,
|
||||
self,
|
||||
-1,
|
||||
|
|
|
@ -3108,8 +3108,8 @@ config_changed(NMConfig *config,
|
|||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
gboolean old_iwd_ac = priv->iwd_autoconnect;
|
||||
|
||||
priv->iwd_autoconnect =
|
||||
nm_config_data_get_device_config_boolean(config_data,
|
||||
priv->iwd_autoconnect = nm_config_data_get_device_config_boolean_by_device(
|
||||
config_data,
|
||||
NM_CONFIG_KEYFILE_KEY_DEVICE_WIFI_IWD_AUTOCONNECT,
|
||||
NM_DEVICE(self),
|
||||
TRUE,
|
||||
|
|
|
@ -1398,7 +1398,7 @@ _hw_addr_set_scanning(NMDeviceWifi *self, gboolean do_reset)
|
|||
|
||||
priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
|
||||
randomize = nm_config_data_get_device_config_boolean(
|
||||
randomize = nm_config_data_get_device_config_boolean_by_device(
|
||||
NM_CONFIG_GET_DATA,
|
||||
NM_CONFIG_KEYFILE_KEY_DEVICE_WIFI_SCAN_RAND_MAC_ADDRESS,
|
||||
device,
|
||||
|
@ -1431,7 +1431,7 @@ _hw_addr_set_scanning(NMDeviceWifi *self, gboolean do_reset)
|
|||
* a new one.*/
|
||||
priv->hw_addr_scan_expire = now + SCAN_RAND_MAC_ADDRESS_EXPIRE_SEC;
|
||||
|
||||
generate_mac_address_mask = nm_config_data_get_device_config(
|
||||
generate_mac_address_mask = nm_config_data_get_device_config_by_device(
|
||||
NM_CONFIG_GET_DATA,
|
||||
NM_CONFIG_KEYFILE_KEY_DEVICE_WIFI_SCAN_GENERATE_MAC_ADDRESS_MASK,
|
||||
device,
|
||||
|
|
|
@ -375,7 +375,7 @@ nm_config_data_get_ignore_carrier(const NMConfigData *self, NMDevice *device)
|
|||
g_return_val_if_fail(NM_IS_CONFIG_DATA(self), FALSE);
|
||||
g_return_val_if_fail(NM_IS_DEVICE(device), FALSE);
|
||||
|
||||
value = nm_config_data_get_device_config(self,
|
||||
value = nm_config_data_get_device_config_by_device(self,
|
||||
NM_CONFIG_KEYFILE_KEY_DEVICE_IGNORE_CARRIER,
|
||||
device,
|
||||
&has_match);
|
||||
|
@ -1547,7 +1547,7 @@ out:
|
|||
}
|
||||
|
||||
const char *
|
||||
nm_config_data_get_device_config(const NMConfigData *self,
|
||||
nm_config_data_get_device_config_by_device(const NMConfigData *self,
|
||||
const char *property,
|
||||
NMDevice *device,
|
||||
gboolean *has_match)
|
||||
|
@ -1606,7 +1606,7 @@ nm_config_data_get_device_config_by_pllink(const NMConfigData *self,
|
|||
}
|
||||
|
||||
gboolean
|
||||
nm_config_data_get_device_config_boolean(const NMConfigData *self,
|
||||
nm_config_data_get_device_config_boolean_by_device(const NMConfigData *self,
|
||||
const char *property,
|
||||
NMDevice *device,
|
||||
int val_no_match,
|
||||
|
@ -1615,14 +1615,14 @@ nm_config_data_get_device_config_boolean(const NMConfigData *self,
|
|||
const char *value;
|
||||
gboolean has_match;
|
||||
|
||||
value = nm_config_data_get_device_config(self, property, device, &has_match);
|
||||
value = nm_config_data_get_device_config_by_device(self, property, device, &has_match);
|
||||
if (!has_match)
|
||||
return val_no_match;
|
||||
return nm_config_parse_boolean(value, val_invalid);
|
||||
}
|
||||
|
||||
gint64
|
||||
nm_config_data_get_device_config_int64(const NMConfigData *self,
|
||||
nm_config_data_get_device_config_int64_by_device(const NMConfigData *self,
|
||||
const char *property,
|
||||
NMDevice *device,
|
||||
int base,
|
||||
|
@ -1634,7 +1634,7 @@ nm_config_data_get_device_config_int64(const NMConfigData *self,
|
|||
const char *value;
|
||||
gboolean has_match;
|
||||
|
||||
value = nm_config_data_get_device_config(self, property, device, &has_match);
|
||||
value = nm_config_data_get_device_config_by_device(self, property, device, &has_match);
|
||||
if (!has_match) {
|
||||
errno = ENOENT;
|
||||
return val_no_match;
|
||||
|
|
|
@ -219,7 +219,7 @@ gint64 nm_config_data_get_connection_default_int64(const NMConfigData *self,
|
|||
gint64 max,
|
||||
gint64 fallback);
|
||||
|
||||
const char *nm_config_data_get_device_config(const NMConfigData *self,
|
||||
const char *nm_config_data_get_device_config_by_device(const NMConfigData *self,
|
||||
const char *property,
|
||||
NMDevice *device,
|
||||
gboolean *has_match);
|
||||
|
@ -230,12 +230,12 @@ const char *nm_config_data_get_device_config_by_pllink(const NMConfigData *sel
|
|||
const char *match_device_type,
|
||||
gboolean *has_match);
|
||||
|
||||
gboolean nm_config_data_get_device_config_boolean(const NMConfigData *self,
|
||||
gboolean nm_config_data_get_device_config_boolean_by_device(const NMConfigData *self,
|
||||
const char *property,
|
||||
NMDevice *device,
|
||||
int val_no_match,
|
||||
int val_invalid);
|
||||
gint64 nm_config_data_get_device_config_int64(const NMConfigData *self,
|
||||
gint64 nm_config_data_get_device_config_int64_by_device(const NMConfigData *self,
|
||||
const char *property,
|
||||
NMDevice *device,
|
||||
int base,
|
||||
|
|
|
@ -3379,7 +3379,8 @@ get_existing_connection(NMManager *self, NMDevice *device, gboolean *out_generat
|
|||
}
|
||||
}
|
||||
|
||||
if (nm_config_data_get_device_config_boolean(NM_CONFIG_GET_DATA,
|
||||
if (nm_config_data_get_device_config_boolean_by_device(
|
||||
NM_CONFIG_GET_DATA,
|
||||
NM_CONFIG_KEYFILE_KEY_DEVICE_KEEP_CONFIGURATION,
|
||||
device,
|
||||
TRUE,
|
||||
|
|
Loading…
Reference in a new issue