summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-01-10 11:04:57 +0100
committerThomas Haller <thaller@redhat.com>2018-01-10 11:05:00 +0100
commit96658d2fd11410b01d11ace62a89899dd7958ee4 (patch)
treeaaf420904784092b5c11ebf6d8684484971605ac
parent97f06c3a6d7c984b3bc0f61dcf2885fed7a948c7 (diff)
parent681d2bcd7042ba564c16a02cd397ccbfce22975c (diff)
downloadNetworkManager-96658d2fd11410b01d11ace62a89899dd7958ee4.tar.gz
all: merge branch 'th/pr/53' (part 1)
Partly merge pull request #52. https://github.com/NetworkManager/NetworkManager/pull/52
-rw-r--r--configure.ac4
-rw-r--r--src/devices/nm-device-factory.c69
2 files changed, 42 insertions, 31 deletions
diff --git a/configure.ac b/configure.ac
index 141e07a390..8afebe4cc5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1370,6 +1370,10 @@ echo
echo "System paths:"
echo " prefix: $prefix"
echo " exec_prefix: $exec_prefix"
+echo " sysconfdir: $sysconfdir"
+echo " localstatedir: $localstatedir"
+echo " runstatedir: $runstatedir"
+echo " datadir: $datadir"
echo " systemdunitdir: $with_systemdsystemunitdir"
echo " nmbinary: $nmbinary"
echo " nmconfdir: $nmconfdir"
diff --git a/src/devices/nm-device-factory.c b/src/devices/nm-device-factory.c
index 9bfdd8e099..d8e303460c 100644
--- a/src/devices/nm-device-factory.c
+++ b/src/devices/nm-device-factory.c
@@ -340,42 +340,16 @@ factories_list_unref (GSList *list)
g_slist_free_full (list, g_object_unref);
}
-void
-nm_device_factory_manager_load_factories (NMDeviceFactoryManagerFactoryFunc callback,
- gpointer user_data)
+static void
+load_factories_from_dir (const char *dirname,
+ NMDeviceFactoryManagerFactoryFunc callback,
+ gpointer user_data)
{
NMDeviceFactory *factory;
GError *error = NULL;
char **path, **paths;
- g_return_if_fail (factories_by_link == NULL);
- g_return_if_fail (factories_by_setting == NULL);
-
- factories_by_link = g_hash_table_new_full (nm_direct_hash, NULL, NULL, g_object_unref);
- factories_by_setting = g_hash_table_new_full (nm_str_hash, g_str_equal, NULL, (GDestroyNotify) factories_list_unref);
-
-#define _ADD_INTERNAL(get_type_fcn) \
- G_STMT_START { \
- GType get_type_fcn (void); \
- _load_internal_factory (get_type_fcn (), \
- callback, user_data); \
- } G_STMT_END
-
- _ADD_INTERNAL (nm_bond_device_factory_get_type);
- _ADD_INTERNAL (nm_bridge_device_factory_get_type);
- _ADD_INTERNAL (nm_dummy_device_factory_get_type);
- _ADD_INTERNAL (nm_ethernet_device_factory_get_type);
- _ADD_INTERNAL (nm_infiniband_device_factory_get_type);
- _ADD_INTERNAL (nm_ip_tunnel_device_factory_get_type);
- _ADD_INTERNAL (nm_macsec_device_factory_get_type);
- _ADD_INTERNAL (nm_macvlan_device_factory_get_type);
- _ADD_INTERNAL (nm_ppp_device_factory_get_type);
- _ADD_INTERNAL (nm_tun_device_factory_get_type);
- _ADD_INTERNAL (nm_veth_device_factory_get_type);
- _ADD_INTERNAL (nm_vlan_device_factory_get_type);
- _ADD_INTERNAL (nm_vxlan_device_factory_get_type);
-
- paths = nm_utils_read_plugin_paths (NMPLUGINDIR, PLUGIN_PREFIX);
+ paths = nm_utils_read_plugin_paths (dirname, PLUGIN_PREFIX);
if (!paths)
return;
@@ -420,3 +394,36 @@ nm_device_factory_manager_load_factories (NMDeviceFactoryManagerFactoryFunc call
g_strfreev (paths);
}
+void
+nm_device_factory_manager_load_factories (NMDeviceFactoryManagerFactoryFunc callback,
+ gpointer user_data)
+{
+ g_return_if_fail (factories_by_link == NULL);
+ g_return_if_fail (factories_by_setting == NULL);
+
+ factories_by_link = g_hash_table_new_full (nm_direct_hash, NULL, NULL, g_object_unref);
+ factories_by_setting = g_hash_table_new_full (nm_str_hash, g_str_equal, NULL, (GDestroyNotify) factories_list_unref);
+
+#define _ADD_INTERNAL(get_type_fcn) \
+ G_STMT_START { \
+ GType get_type_fcn (void); \
+ _load_internal_factory (get_type_fcn (), \
+ callback, user_data); \
+ } G_STMT_END
+
+ _ADD_INTERNAL (nm_bond_device_factory_get_type);
+ _ADD_INTERNAL (nm_bridge_device_factory_get_type);
+ _ADD_INTERNAL (nm_dummy_device_factory_get_type);
+ _ADD_INTERNAL (nm_ethernet_device_factory_get_type);
+ _ADD_INTERNAL (nm_infiniband_device_factory_get_type);
+ _ADD_INTERNAL (nm_ip_tunnel_device_factory_get_type);
+ _ADD_INTERNAL (nm_macsec_device_factory_get_type);
+ _ADD_INTERNAL (nm_macvlan_device_factory_get_type);
+ _ADD_INTERNAL (nm_ppp_device_factory_get_type);
+ _ADD_INTERNAL (nm_tun_device_factory_get_type);
+ _ADD_INTERNAL (nm_veth_device_factory_get_type);
+ _ADD_INTERNAL (nm_vlan_device_factory_get_type);
+ _ADD_INTERNAL (nm_vxlan_device_factory_get_type);
+
+ load_factories_from_dir (NMPLUGINDIR, callback, user_data);
+}