mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 12:28:11 +02:00
core: use nm_config_data_get_device_config_int64() for getting integer setting
This commit is contained in:
parent
a6c9f2518e
commit
b929caa95c
1 changed files with 19 additions and 15 deletions
|
|
@ -5874,16 +5874,19 @@ sriov_op_queue(NMDevice * self,
|
||||||
static void
|
static void
|
||||||
device_init_static_sriov_num_vfs(NMDevice *self)
|
device_init_static_sriov_num_vfs(NMDevice *self)
|
||||||
{
|
{
|
||||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
|
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
|
||||||
gs_free char * value = NULL;
|
|
||||||
int num_vfs;
|
|
||||||
|
|
||||||
if (priv->ifindex > 0 && nm_device_has_capability(self, NM_DEVICE_CAP_SRIOV)) {
|
if (priv->ifindex > 0 && nm_device_has_capability(self, NM_DEVICE_CAP_SRIOV)) {
|
||||||
value = nm_config_data_get_device_config(NM_CONFIG_GET_DATA,
|
int num_vfs;
|
||||||
NM_CONFIG_KEYFILE_KEY_DEVICE_SRIOV_NUM_VFS,
|
|
||||||
self,
|
num_vfs = nm_config_data_get_device_config_int64(NM_CONFIG_GET_DATA,
|
||||||
NULL);
|
NM_CONFIG_KEYFILE_KEY_DEVICE_SRIOV_NUM_VFS,
|
||||||
num_vfs = _nm_utils_ascii_str_to_int64(value, 10, 0, G_MAXINT32, -1);
|
self,
|
||||||
|
10,
|
||||||
|
0,
|
||||||
|
G_MAXINT32,
|
||||||
|
-1,
|
||||||
|
-1);
|
||||||
if (num_vfs >= 0)
|
if (num_vfs >= 0)
|
||||||
sriov_op_queue(self, num_vfs, NM_OPTION_BOOL_DEFAULT, NULL, NULL);
|
sriov_op_queue(self, num_vfs, NM_OPTION_BOOL_DEFAULT, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
@ -14043,13 +14046,14 @@ nm_device_is_up(NMDevice *self)
|
||||||
static gint64
|
static gint64
|
||||||
_get_carrier_wait_ms(NMDevice *self)
|
_get_carrier_wait_ms(NMDevice *self)
|
||||||
{
|
{
|
||||||
gs_free char *value = NULL;
|
return nm_config_data_get_device_config_int64(NM_CONFIG_GET_DATA,
|
||||||
|
NM_CONFIG_KEYFILE_KEY_DEVICE_CARRIER_WAIT_TIMEOUT,
|
||||||
value = nm_config_data_get_device_config(NM_CONFIG_GET_DATA,
|
self,
|
||||||
NM_CONFIG_KEYFILE_KEY_DEVICE_CARRIER_WAIT_TIMEOUT,
|
10,
|
||||||
self,
|
0,
|
||||||
NULL);
|
G_MAXINT32,
|
||||||
return _nm_utils_ascii_str_to_int64(value, 10, 0, G_MAXINT32, CARRIER_WAIT_TIME_MS);
|
CARRIER_WAIT_TIME_MS,
|
||||||
|
CARRIER_WAIT_TIME_MS);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue