ovs: block auto activation of ovs-interfaces until ovsdb is ready

Otherwise the device tries to activate too early and fails.
This commit is contained in:
Beniamino Galvani 2021-05-17 13:54:49 +02:00
parent e694f2cec1
commit a3f35ea5cc

View file

@ -77,6 +77,15 @@ is_available(NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
return nm_ovsdb_is_ready(priv->ovsdb);
}
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)
{
@ -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;