mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 00:30:17 +01:00
core: pass parent to device factories when creating devices for connections
We'll use it later for InfiniBand and VLAN.
This commit is contained in:
parent
560fe126b5
commit
706b9d2056
4 changed files with 9 additions and 3 deletions
|
|
@ -124,6 +124,7 @@ nm_device_factory_new_link (NMDeviceFactory *factory,
|
|||
NMDevice *
|
||||
nm_device_factory_create_virtual_device_for_connection (NMDeviceFactory *factory,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceFactory *interface;
|
||||
|
|
@ -134,7 +135,7 @@ nm_device_factory_create_virtual_device_for_connection (NMDeviceFactory *factory
|
|||
|
||||
interface = NM_DEVICE_FACTORY_GET_INTERFACE (factory);
|
||||
if (interface->create_virtual_device_for_connection)
|
||||
return interface->create_virtual_device_for_connection (factory, connection, error);
|
||||
return interface->create_virtual_device_for_connection (factory, connection, parent, error);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ struct _NMDeviceFactory {
|
|||
*/
|
||||
NMDevice * (*create_virtual_device_for_connection) (NMDeviceFactory *factory,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
GError **error);
|
||||
|
||||
|
||||
|
|
@ -160,6 +161,7 @@ NMDevice * nm_device_factory_new_link (NMDeviceFactory *factory,
|
|||
|
||||
NMDevice * nm_device_factory_create_virtual_device_for_connection (NMDeviceFactory *factory,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
GError **error);
|
||||
|
||||
/* For use by implementations */
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ new_link (NMDeviceFactory *factory, NMPlatformLink *plink, GError **error)
|
|||
static NMDevice *
|
||||
create_virtual_device_for_connection (NMDeviceFactory *factory,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
GError **error)
|
||||
{
|
||||
if (nm_connection_is_type (connection, NM_SETTING_TEAM_SETTING_NAME))
|
||||
|
|
|
|||
|
|
@ -1063,8 +1063,10 @@ system_create_virtual_device (NMManager *self, NMConnection *connection)
|
|||
device = nm_device_infiniband_new_partition (connection, parent);
|
||||
} else {
|
||||
for (iter = priv->factories; iter; iter = iter->next) {
|
||||
device = nm_device_factory_create_virtual_device_for_connection (NM_DEVICE_FACTORY (iter->data), connection, &error);
|
||||
|
||||
device = nm_device_factory_create_virtual_device_for_connection (NM_DEVICE_FACTORY (iter->data),
|
||||
connection,
|
||||
parent,
|
||||
&error);
|
||||
if (device || error) {
|
||||
if (device)
|
||||
g_assert_no_error (error);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue