ifcfg: don't forget master of ovs interfaces

https://bugzilla.redhat.com/show_bug.cgi?id=1519179
(cherry picked from commit 1440fe6a88)
This commit is contained in:
Lubomir Rintel 2018-01-18 10:13:43 +01:00
parent a30b2fcd84
commit c778d9a252
2 changed files with 23 additions and 0 deletions

View file

@ -293,6 +293,23 @@ make_connection_setting (const char *file,
check_if_bond_slave (ifcfg, s_con);
check_if_team_slave (ifcfg, s_con);
nm_clear_g_free (&value);
v = svGetValueStr (ifcfg, "OVS_PORT_UUID", &value);
if (!v)
v = svGetValueStr (ifcfg, "OVS_PORT", &value);
if (v) {
const char *old_value;
if ((old_value = nm_setting_connection_get_master (s_con))) {
PARSE_WARNING ("Already configured as slave of %s. Ignoring OVS_PORT=\"%s\"",
old_value, v);
} else {
g_object_set (s_con, NM_SETTING_CONNECTION_MASTER, v, NULL);
g_object_set (s_con, NM_SETTING_CONNECTION_SLAVE_TYPE,
NM_SETTING_OVS_PORT_SETTING_NAME, NULL);
}
}
nm_clear_g_free (&value);
v = svGetValueStr (ifcfg, "GATEWAY_PING_TIMEOUT", &value);
if (v) {

View file

@ -1832,6 +1832,12 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg)
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)) {
svSetValueStr (ifcfg, "OVS_PORT_UUID", master);
svSetValueStr (ifcfg, "OVS_PORT", master_iface);
} else {
_LOGW ("don't know how to set master for a %s slave",
nm_setting_connection_get_slave_type (s_con));
}
}