ovs: don't release slaves on quit

An OVS bridge and its slaves can continue to work even after NM has
quit. Keep the interface enslaved when the @configure argument of
device->release_slave() is FALSE, which happens on quit and in other
circumstances when we don't really want to release the slave from its
master.

https://bugzilla.redhat.com/show_bug.cgi?id=1733709
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/215
(cherry picked from commit ccd4be4014)
(cherry picked from commit a1f39b69e0)
(cherry picked from commit f93018a41a)
(cherry picked from commit 647c054bce)
This commit is contained in:
Beniamino Galvani 2019-07-29 16:13:27 +02:00
parent ecaf1acb76
commit e4167a6c81

View file

@ -166,8 +166,14 @@ del_iface_cb (GError *error, gpointer user_data)
static void
release_slave (NMDevice *device, NMDevice *slave, gboolean configure)
{
nm_ovsdb_del_interface (nm_ovsdb_get (), nm_device_get_iface (slave),
del_iface_cb, g_object_ref (slave));
NMDeviceOvsPort *self = NM_DEVICE_OVS_PORT (device);
if (configure) {
_LOGI (LOGD_DEVICE, "releasing ovs interface %s", nm_device_get_ip_iface (slave));
nm_ovsdb_del_interface (nm_ovsdb_get (), nm_device_get_iface (slave),
del_iface_cb, g_object_ref (slave));
} else
_LOGI (LOGD_DEVICE, "ovs interface %s was released", nm_device_get_ip_iface (slave));
}
/*****************************************************************************/