mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-06 17:14:02 +00:00
connection: drop the usage of nm_setting_connection_is_slave_type()
As the function is deperecated, drop the usage of it. In addition replace the !g_strcmp0() usage for nm_streq0().
This commit is contained in:
parent
411e7573a4
commit
1e3bb7f320
|
@ -2260,22 +2260,26 @@ write_connection_setting(NMSettingConnection *s_con, shvarFile *ifcfg, const cha
|
|||
master = NULL;
|
||||
}
|
||||
|
||||
if (nm_setting_connection_is_slave_type(s_con, NM_SETTING_BOND_SETTING_NAME)) {
|
||||
if (nm_streq0(nm_setting_connection_get_port_type(s_con), NM_SETTING_BOND_SETTING_NAME)) {
|
||||
svSetValueStr(ifcfg, "MASTER_UUID", master);
|
||||
svSetValueStr(ifcfg, "MASTER", master_iface);
|
||||
svSetValueStr(ifcfg, "SLAVE", "yes");
|
||||
} else if (nm_setting_connection_is_slave_type(s_con, NM_SETTING_BRIDGE_SETTING_NAME)) {
|
||||
} else if (nm_streq0(nm_setting_connection_get_port_type(s_con),
|
||||
NM_SETTING_BRIDGE_SETTING_NAME)) {
|
||||
svSetValueStr(ifcfg, "BRIDGE_UUID", master);
|
||||
svSetValueStr(ifcfg, "BRIDGE", master_iface);
|
||||
} else if (nm_setting_connection_is_slave_type(s_con, NM_SETTING_TEAM_SETTING_NAME)) {
|
||||
} else if (nm_streq0(nm_setting_connection_get_port_type(s_con),
|
||||
NM_SETTING_TEAM_SETTING_NAME)) {
|
||||
svSetValueStr(ifcfg, "TEAM_MASTER_UUID", master);
|
||||
svSetValueStr(ifcfg, "TEAM_MASTER", master_iface);
|
||||
if (NM_IN_STRSET(type, NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_VLAN_SETTING_NAME))
|
||||
svUnsetValue(ifcfg, "TYPE");
|
||||
} else if (nm_setting_connection_is_slave_type(s_con, NM_SETTING_OVS_PORT_SETTING_NAME)) {
|
||||
} else if (nm_streq0(nm_setting_connection_get_port_type(s_con),
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME)) {
|
||||
svSetValueStr(ifcfg, "OVS_PORT_UUID", master);
|
||||
svSetValueStr(ifcfg, "OVS_PORT", master_iface);
|
||||
} else if (nm_setting_connection_is_slave_type(s_con, NM_SETTING_VRF_SETTING_NAME)) {
|
||||
} else if (nm_streq0(nm_setting_connection_get_port_type(s_con),
|
||||
NM_SETTING_VRF_SETTING_NAME)) {
|
||||
svSetValueStr(ifcfg, "VRF_UUID", master);
|
||||
svSetValueStr(ifcfg, "VRF", master_iface);
|
||||
} else {
|
||||
|
@ -2287,7 +2291,7 @@ write_connection_setting(NMSettingConnection *s_con, shvarFile *ifcfg, const cha
|
|||
if (nm_streq0(type, NM_SETTING_TEAM_SETTING_NAME))
|
||||
svSetValueStr(ifcfg, "DEVICETYPE", TYPE_TEAM);
|
||||
else if (master_iface
|
||||
&& nm_setting_connection_is_slave_type(s_con, NM_SETTING_TEAM_SETTING_NAME))
|
||||
&& nm_streq0(nm_setting_connection_get_port_type(s_con), NM_SETTING_TEAM_SETTING_NAME))
|
||||
svSetValueStr(ifcfg, "DEVICETYPE", TYPE_TEAM_PORT);
|
||||
|
||||
/* secondary connection UUIDs */
|
||||
|
|
|
@ -2004,7 +2004,7 @@ test_read_bridge_component(void)
|
|||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, expected_id);
|
||||
g_assert_cmpstr(nm_setting_connection_get_uuid(s_con), ==, expected_uuid);
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, "br0");
|
||||
g_assert(nm_setting_connection_is_slave_type(s_con, NM_SETTING_BRIDGE_SETTING_NAME));
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
|
||||
s_wired = nm_connection_get_setting_wired(connection);
|
||||
g_assert(s_wired);
|
||||
|
|
|
@ -790,7 +790,7 @@ nm_setting_connection_is_slave_type(NMSettingConnection *setting, const char *ty
|
|||
{
|
||||
g_return_val_if_fail(NM_IS_SETTING_CONNECTION(setting), FALSE);
|
||||
|
||||
return !g_strcmp0(NM_SETTING_CONNECTION_GET_PRIVATE(setting)->port_type, type);
|
||||
return nm_streq0(NM_SETTING_CONNECTION_GET_PRIVATE(setting)->port_type, type);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue