mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-14 02:00:31 +01:00
ovs: ignore failures of patch interfaces
When there are two patch ports connected, each of them must reference the other; however they can't be created in a single transaction because they are part of different bridges (so, different connections). Therefore, the first patch that gets activated will always fail with "No usable peer $x exists in 'system' datapath" until the second patch exists. In theory we could also match the error message, however this doesn't seem very robust as the message may slightly change in the future. (cherry picked from commitffeac35f04) (cherry picked from commit75cbf21738)
This commit is contained in:
parent
9b82c62f33
commit
399aad15bf
1 changed files with 31 additions and 6 deletions
|
|
@ -142,15 +142,40 @@ ovsdb_interface_failed (NMOvsdb *ovsdb,
|
|||
{
|
||||
NMDevice *device = NULL;
|
||||
NMSettingsConnection *connection = NULL;
|
||||
|
||||
_LOGI (name, connection_uuid, "ovs interface \"%s\" (%s) failed: %s", name, connection_uuid, error);
|
||||
NMConnection *c;
|
||||
const char *type;
|
||||
NMSettingOvsInterface *s_ovs_int;
|
||||
gboolean is_patch = FALSE;
|
||||
gboolean ignore;
|
||||
|
||||
device = nm_manager_get_device (NM_MANAGER_GET, name, NM_DEVICE_TYPE_OVS_INTERFACE);
|
||||
if (!device)
|
||||
return;
|
||||
if (device && connection_uuid) {
|
||||
connection = nm_settings_get_connection_by_uuid (nm_device_get_settings (device),
|
||||
connection_uuid);
|
||||
}
|
||||
|
||||
if (connection_uuid)
|
||||
connection = nm_settings_get_connection_by_uuid (nm_device_get_settings (device), connection_uuid);
|
||||
/* The patch interface which gets created first is expected to
|
||||
* fail because the second patch doesn't exist yet. Ignore all
|
||||
* failures of patch interfaces. */
|
||||
if ( connection
|
||||
&& (c = nm_settings_connection_get_connection (connection))
|
||||
&& (type = nm_connection_get_connection_type (c))
|
||||
&& nm_streq0 (type, NM_SETTING_OVS_INTERFACE_SETTING_NAME)
|
||||
&& (s_ovs_int = nm_connection_get_setting_ovs_interface (c))
|
||||
&& nm_streq0 (nm_setting_ovs_interface_get_interface_type (s_ovs_int), "patch"))
|
||||
is_patch = TRUE;
|
||||
|
||||
ignore = !device || is_patch;
|
||||
|
||||
_NMLOG (ignore ? LOGL_DEBUG : LOGL_INFO,
|
||||
name, connection_uuid,
|
||||
"ovs interface \"%s\" (%s) failed%s: %s",
|
||||
name, connection_uuid,
|
||||
ignore ? " (ignored)" : "",
|
||||
error);
|
||||
|
||||
if (ignore)
|
||||
return;
|
||||
|
||||
if (connection) {
|
||||
nm_settings_connection_autoconnect_blocked_reason_set (connection,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue