Diff between bc06a970257730dcccc632839889efe087c30f47 and 21f71192a92b93006e6358531e0aa46de192acb9

Changed Files

File Additions Deletions Status
src/hcid.h +1 -2 modified
src/main.c +1 -2 modified
src/main.conf +0 -3 modified
src/plugin.c +7 -26 modified

Full Patch

diff --git a/src/hcid.h b/src/hcid.h
index aa563dc..5752da9 100644
--- a/src/hcid.h
+++ b/src/hcid.h
@@ -50,8 +50,7 @@ enum {
 
 extern struct main_opts main_opts;
 
-gboolean plugin_init(GKeyFile *config, const char *enable,
-							const char *disable);
+gboolean plugin_init(const char *enable, const char *disable);
 void plugin_cleanup(void);
 
 void rfkill_init(void);
diff --git a/src/main.c b/src/main.c
index d302ffa..7922222 100644
--- a/src/main.c
+++ b/src/main.c
@@ -68,7 +68,6 @@ struct main_opts main_opts;
 
 static const char * const supported_options[] = {
 	"Name",
-	"DisablePlugins",
 	"Class",
 	"DiscoverableTimeout",
 	"PairableTimeout",
@@ -539,7 +538,7 @@ int main(int argc, char *argv[])
 	 * the plugins might wanna expose some paths on the bus. However the
 	 * best order of how to init various subsystems of the Bluetooth
 	 * daemon needs to be re-worked. */
-	plugin_init(config, option_plugin, option_noplugin);
+	plugin_init(option_plugin, option_noplugin);
 
 	/* no need to keep parsed option in memory */
 	free_options();
diff --git a/src/main.conf b/src/main.conf
index 97b4519..8bb82f6 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -1,8 +1,5 @@
 [General]
 
-# List of plugins that should not be loaded on bluetoothd startup
-#DisablePlugins = network,input
-
 # Default adaper name
 # %h - substituted for hostname
 # %d - substituted for adapter id
diff --git a/src/plugin.c b/src/plugin.c
index 5622d7b..f231f34 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -84,19 +84,9 @@ static gboolean add_plugin(void *handle, struct bluetooth_plugin_desc *desc)
 	return TRUE;
 }
 
-static gboolean enable_plugin(const char *name, char **conf_disable,
-					char **cli_enable, char **cli_disable)
+static gboolean enable_plugin(const char *name, char **cli_enable,
+							char **cli_disable)
 {
-	if (conf_disable) {
-		for (; *conf_disable; conf_disable++)
-			if (g_pattern_match_simple(*conf_disable, name))
-				break;
-		if (*conf_disable) {
-			info("Excluding (conf) %s", name);
-			return FALSE;
-		}
-	}
-
 	if (cli_disable) {
 		for (; *cli_disable; cli_disable++)
 			if (g_pattern_match_simple(*cli_disable, name))
@@ -122,25 +112,18 @@ static gboolean enable_plugin(const char *name, char **conf_disable,
 
 #include "builtin.h"
 
-gboolean plugin_init(GKeyFile *config, const char *enable, const char *disable)
+gboolean plugin_init(const char *enable, const char *disable)
 {
 	GSList *list;
 	GDir *dir;
 	const gchar *file;
-	char **conf_disabled, **cli_disabled, **cli_enabled;
+	char **cli_disabled, **cli_enabled;
 	unsigned int i;
 
 	/* Make a call to BtIO API so its symbols got resolved before the
 	 * plugins are loaded. */
 	bt_io_error_quark();
 
-	if (config)
-		conf_disabled = g_key_file_get_string_list(config, "General",
-							"DisablePlugins",
-							NULL, NULL);
-	else
-		conf_disabled = NULL;
-
 	if (enable)
 		cli_enabled = g_strsplit_set(enable, ", ", -1);
 	else
@@ -154,8 +137,8 @@ gboolean plugin_init(GKeyFile *config, const char *enable, const char *disable)
 	DBG("Loading builtin plugins");
 
 	for (i = 0; __bluetooth_builtin[i]; i++) {
-		if (!enable_plugin(__bluetooth_builtin[i]->name, conf_disabled,
-						cli_enabled, cli_disabled))
+		if (!enable_plugin(__bluetooth_builtin[i]->name, cli_enabled,
+								cli_disabled))
 			continue;
 
 		add_plugin(NULL,  __bluetooth_builtin[i]);
@@ -198,8 +181,7 @@ gboolean plugin_init(GKeyFile *config, const char *enable, const char *disable)
 			continue;
 		}
 
-		if (!enable_plugin(desc->name, conf_disabled,
-						cli_enabled, cli_disabled)) {
+		if (!enable_plugin(desc->name, cli_enabled, cli_disabled)) {
 			dlclose(handle);
 			continue;
 		}
@@ -222,7 +204,6 @@ start:
 		plugin->active = TRUE;
 	}
 
-	g_strfreev(conf_disabled);
 	g_strfreev(cli_enabled);
 	g_strfreev(cli_disabled);