mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 01:20:35 +01:00
merge: branch 'lr/ovs-generic'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2207
This commit is contained in:
commit
7ee8d84a1e
2 changed files with 20 additions and 8 deletions
|
|
@ -75,9 +75,6 @@ new_device_from_type(const char *name, NMDeviceType device_type)
|
|||
const char *type_desc;
|
||||
NMLinkType link_type = NM_LINK_TYPE_NONE;
|
||||
|
||||
if (nm_manager_get_device(NM_MANAGER_GET, name, device_type))
|
||||
return NULL;
|
||||
|
||||
if (device_type == NM_DEVICE_TYPE_OVS_INTERFACE) {
|
||||
type = NM_TYPE_DEVICE_OVS_INTERFACE;
|
||||
type_desc = "Open vSwitch Interface";
|
||||
|
|
@ -89,6 +86,7 @@ new_device_from_type(const char *name, NMDeviceType device_type)
|
|||
type = NM_TYPE_DEVICE_OVS_BRIDGE;
|
||||
type_desc = "Open vSwitch Bridge";
|
||||
} else {
|
||||
_LOGT(name, NULL, "Unrecognized link type: %d", device_type);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -125,6 +123,11 @@ ovsdb_device_added(NMOvsdb *ovsdb,
|
|||
return;
|
||||
}
|
||||
|
||||
if (nm_manager_get_device(NM_MANAGER_GET, name, device_type)) {
|
||||
_LOGT(name, NULL, "Device already registered with manager, skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
device = new_device_from_type(name, device_type);
|
||||
if (!device)
|
||||
return;
|
||||
|
|
@ -288,23 +291,31 @@ create_device(NMDeviceFactory *self,
|
|||
{
|
||||
NMDeviceType device_type = NM_DEVICE_TYPE_UNKNOWN;
|
||||
const char *connection_type = NULL;
|
||||
const char *connection_uuid = NULL;
|
||||
|
||||
if (g_strcmp0(iface, "ovs-system") == 0) {
|
||||
*out_ignore = TRUE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (connection)
|
||||
if (connection) {
|
||||
connection_type = nm_connection_get_connection_type(connection);
|
||||
connection_uuid = nm_connection_get_uuid(connection);
|
||||
}
|
||||
|
||||
if (plink)
|
||||
if (plink) {
|
||||
_LOGD(iface, connection_uuid, "creating OVS interface (from a platform link)");
|
||||
device_type = NM_DEVICE_TYPE_OVS_INTERFACE;
|
||||
else if (g_strcmp0(connection_type, NM_SETTING_OVS_INTERFACE_SETTING_NAME) == 0)
|
||||
} else if (nm_streq0(connection_type, NM_SETTING_OVS_INTERFACE_SETTING_NAME)) {
|
||||
_LOGD(iface, connection_uuid, "creating OVS interface (from setting)");
|
||||
device_type = NM_DEVICE_TYPE_OVS_INTERFACE;
|
||||
else if (g_strcmp0(connection_type, NM_SETTING_OVS_PORT_SETTING_NAME) == 0)
|
||||
} else if (nm_streq0(connection_type, NM_SETTING_OVS_PORT_SETTING_NAME)) {
|
||||
_LOGD(iface, connection_uuid, "creating OVS port (from setting)");
|
||||
device_type = NM_DEVICE_TYPE_OVS_PORT;
|
||||
else if (g_strcmp0(connection_type, NM_SETTING_OVS_BRIDGE_SETTING_NAME) == 0)
|
||||
} else if (nm_streq0(connection_type, NM_SETTING_OVS_BRIDGE_SETTING_NAME)) {
|
||||
_LOGD(iface, connection_uuid, "creating OVS bridge (from setting)");
|
||||
device_type = NM_DEVICE_TYPE_OVS_BRIDGE;
|
||||
}
|
||||
|
||||
return new_device_from_type(iface, device_type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4250,6 +4250,7 @@ add:
|
|||
case NM_LINK_TYPE_OLPC_MESH:
|
||||
case NM_LINK_TYPE_TEAM:
|
||||
case NM_LINK_TYPE_WIFI:
|
||||
case NM_LINK_TYPE_OPENVSWITCH:
|
||||
_LOGI(LOGD_PLATFORM,
|
||||
"(%s): '%s' plugin not available; creating generic device",
|
||||
plink->name,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue