Commit 1440fe6a authored by Lubomir Rintel's avatar Lubomir Rintel 🥕
Browse files

ifcfg: don't forget master of ovs interfaces

https://bugzilla.redhat.com/show_bug.cgi?id=1519179
parent f70c1f71
......@@ -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) {
......
......@@ -1840,6 +1840,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));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment