From 2abda4bfa59bfd6de8da69741f2c5f3304e46617 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 18 Sep 2014 12:53:19 -0500 Subject: platform: return link objects from add functions --- src/devices/nm-device-bond.c | 2 +- src/devices/nm-device-bridge.c | 3 ++- src/devices/nm-device-infiniband.c | 2 +- src/devices/nm-device-vlan.c | 3 ++- src/devices/team/nm-device-team.c | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/devices') diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c index 3356125b7c..951954ba6e 100644 --- a/src/devices/nm-device-bond.c +++ b/src/devices/nm-device-bond.c @@ -574,7 +574,7 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, g_assert (iface); - if ( !nm_platform_bond_add (NM_PLATFORM_GET, iface) + if ( !nm_platform_bond_add (NM_PLATFORM_GET, iface, NULL) && nm_platform_get_error (NM_PLATFORM_GET) != NM_PLATFORM_ERROR_EXISTS) { g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED, "Failed to create bond interface '%s' for '%s': %s", diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c index f5219b02dd..ffec9764dd 100644 --- a/src/devices/nm-device-bridge.c +++ b/src/devices/nm-device-bridge.c @@ -513,7 +513,8 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, if ( !nm_platform_bridge_add (NM_PLATFORM_GET, iface, mac_address_str ? mac_address : NULL, - mac_address_str ? ETH_ALEN : 0) + mac_address_str ? ETH_ALEN : 0, + NULL) && nm_platform_get_error (NM_PLATFORM_GET) != NM_PLATFORM_ERROR_EXISTS) { g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED, "Failed to create bridge interface '%s' for '%s': %s", diff --git a/src/devices/nm-device-infiniband.c b/src/devices/nm-device-infiniband.c index c7b8787c45..f9cd946d44 100644 --- a/src/devices/nm-device-infiniband.c +++ b/src/devices/nm-device-infiniband.c @@ -327,7 +327,7 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, parent_ifindex = nm_device_get_ifindex (parent); p_key = nm_setting_infiniband_get_p_key (s_infiniband); - if ( !nm_platform_infiniband_partition_add (NM_PLATFORM_GET, parent_ifindex, p_key) + if ( !nm_platform_infiniband_partition_add (NM_PLATFORM_GET, parent_ifindex, p_key, NULL) && nm_platform_get_error (NM_PLATFORM_GET) != NM_PLATFORM_ERROR_EXISTS) { g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED, "Failed to create InfiniBand P_Key interface '%s' for '%s': %s", diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c index ba79a6ccb1..7d374348e7 100644 --- a/src/devices/nm-device-vlan.c +++ b/src/devices/nm-device-vlan.c @@ -715,7 +715,8 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, iface, nm_device_get_ifindex (parent), nm_setting_vlan_get_id (s_vlan), - nm_setting_vlan_get_flags (s_vlan)) + nm_setting_vlan_get_flags (s_vlan), + NULL) && nm_platform_get_error (NM_PLATFORM_GET) != NM_PLATFORM_ERROR_EXISTS) { g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED, "Failed to create VLAN interface '%s' for '%s': %s", diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c index 5cefde770c..1f80d543c4 100644 --- a/src/devices/team/nm-device-team.c +++ b/src/devices/team/nm-device-team.c @@ -692,7 +692,7 @@ nm_device_team_new_for_connection (NMConnection *connection, GError **error) g_assert (iface); - if ( !nm_platform_team_add (NM_PLATFORM_GET, iface) + if ( !nm_platform_team_add (NM_PLATFORM_GET, iface, NULL) && nm_platform_get_error (NM_PLATFORM_GET) != NM_PLATFORM_ERROR_EXISTS) { g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED, "Failed to create team master interface '%s' for '%s': %s", -- cgit v1.2.1