summary refs log tree commit diff
path: root/src/devices/nm-device-factory.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/nm-device-factory.c')
-rw-r--r--src/devices/nm-device-factory.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/devices/nm-device-factory.c b/src/devices/nm-device-factory.c
index 5ce4333f..9dfa9bcb 100644
--- a/src/devices/nm-device-factory.c
+++ b/src/devices/nm-device-factory.c
@@ -91,6 +91,8 @@ nm_device_factory_create_device (NMDeviceFactory *factory,
 	const NMLinkType *link_types = NULL;
 	const char **setting_types = NULL;
 	int i;
+	NMDevice *device;
+	gboolean ignore = FALSE;
 
 	g_return_val_if_fail (factory, NULL);
 	g_return_val_if_fail (iface && *iface, NULL);
@@ -99,6 +101,8 @@ nm_device_factory_create_device (NMDeviceFactory *factory,
 
 	nm_device_factory_get_supported_types (factory, &link_types, &setting_types);
 
+	NM_SET_OUT (out_ignore, FALSE);
+
 	if (plink) {
 		g_return_val_if_fail (strcmp (iface, plink->name) == 0, NULL);
 
@@ -137,7 +141,20 @@ nm_device_factory_create_device (NMDeviceFactory *factory,
 		return NULL;
 	}
 
-	return interface->create_device (factory, iface, plink, connection, out_ignore);
+	device = interface->create_device (factory, iface, plink, connection, &ignore);
+	NM_SET_OUT (out_ignore, ignore);
+	if (!device) {
+		if (ignore) {
+			g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED,
+			             "Device factory %s ignores device %s",
+			             G_OBJECT_TYPE_NAME (factory), iface);
+		} else {
+			g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED,
+			             "Device factory %s failed to create device %s",
+			             G_OBJECT_TYPE_NAME (factory), iface);
+		}
+	}
+	return device;
 }
 
 const char *