summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-07-29 16:13:27 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2019-07-29 18:34:54 +0200
commitccd4be4014f9f4cfdd0d298ff387ee7558d5f3a5 (patch)
tree1f1b290800a161f30dd44e135c561e3760688b84
parentf4613248cc59744d6088fe05ae33505a63f33ba8 (diff)
downloadNetworkManager-ccd4be4014f9f4cfdd0d298ff387ee7558d5f3a5.tar.gz
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
-rw-r--r--src/devices/ovs/nm-device-ovs-port.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/devices/ovs/nm-device-ovs-port.c b/src/devices/ovs/nm-device-ovs-port.c
index 35eb739f9a..8a93a5a9d9 100644
--- a/src/devices/ovs/nm-device-ovs-port.c
+++ b/src/devices/ovs/nm-device-ovs-port.c
@@ -140,13 +140,18 @@ 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));
-
- /* Open VSwitch is going to delete this one. We must ignore what happens
- * next with the interface. */
- if (NM_IS_DEVICE_OVS_INTERFACE (slave))
- nm_device_update_from_platform_link (slave, NULL);
+ 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));
+ /* Open VSwitch is going to delete this one. We must ignore what happens
+ * next with the interface. */
+ if (NM_IS_DEVICE_OVS_INTERFACE (slave))
+ nm_device_update_from_platform_link (slave, NULL);
+ } else
+ _LOGI (LOGD_DEVICE, "ovs interface %s was released", nm_device_get_ip_iface (slave));
}
/*****************************************************************************/