summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2021-05-17 13:54:49 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2021-05-19 10:29:11 +0200
commita3f35ea5ccebefbecc5c416e6b21a8f1c8a1388b (patch)
tree956df45cdeaace1caf836d395902f091f582c29d
parente694f2cec1a0e7bc188776c8573e07a4d57851dc (diff)
downloadNetworkManager-bg/rh1955101.tar.gz
ovs: block auto activation of ovs-interfaces until ovsdb is readybg/rh1955101
Otherwise the device tries to activate too early and fails.
-rw-r--r--src/core/devices/ovs/nm-device-ovs-interface.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/devices/ovs/nm-device-ovs-interface.c b/src/core/devices/ovs/nm-device-ovs-interface.c
index ec4de356be..46a612aca7 100644
--- a/src/core/devices/ovs/nm-device-ovs-interface.c
+++ b/src/core/devices/ovs/nm-device-ovs-interface.c
@@ -78,6 +78,15 @@ is_available(NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
}
static gboolean
+can_auto_connect(NMDevice *device, NMSettingsConnection *sett_conn, char **specific_object)
+{
+ NMDeviceOvsInterface * self = NM_DEVICE_OVS_INTERFACE(device);
+ NMDeviceOvsInterfacePrivate *priv = NM_DEVICE_OVS_INTERFACE_GET_PRIVATE(self);
+
+ return nm_ovsdb_is_ready(priv->ovsdb);
+}
+
+static gboolean
check_connection_compatible(NMDevice *device, NMConnection *connection, GError **error)
{
NMSettingOvsInterface *s_ovs_iface;
@@ -424,6 +433,7 @@ nm_device_ovs_interface_class_init(NMDeviceOvsInterfaceClass *klass)
device_class->connection_type_check_compatible = NM_SETTING_OVS_INTERFACE_SETTING_NAME;
device_class->link_types = NM_DEVICE_DEFINE_LINK_TYPES(NM_LINK_TYPE_OPENVSWITCH);
+ device_class->can_auto_connect = can_auto_connect;
device_class->can_update_from_platform_link = can_update_from_platform_link;
device_class->deactivate = deactivate;
device_class->deactivate_async = deactivate_async;