All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] To load/not load specific plugin at start up
@ 2010-09-11  8:58 Zhenhua Zhang
  2010-09-11  8:58 ` [PATCH 1/1] Add support to enable/disable specific plugin Zhenhua Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Zhenhua Zhang @ 2010-09-11  8:58 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 178 bytes --]

Hi,

So I draft this patch to enable/disable plugin when ofono is started, similiar to what connman does. You can use ofonod -P hfp to disable hfp plugin.

Thanks,
Zhenhua

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] Add support to enable/disable specific plugin
  2010-09-11  8:58 [PATCH 0/1] To load/not load specific plugin at start up Zhenhua Zhang
@ 2010-09-11  8:58 ` Zhenhua Zhang
  2010-09-11 10:42   ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Zhenhua Zhang @ 2010-09-11  8:58 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1447 bytes --]

Support to load or not load specific plugin when ofono is started.
E.g., use 'ofonod -P hfp' to disable hfp plugin.
---
 src/main.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/main.c b/src/main.c
index d8df2f2..20bf0d7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -93,6 +93,8 @@ static void system_bus_disconnected(DBusConnection *conn, void *user_data)
 }
 
 static gchar *option_debug = NULL;
+static gchar *option_plugin = NULL;
+static gchar *option_noplugin = NULL;
 static gboolean option_detach = TRUE;
 static gboolean option_version = FALSE;
 
@@ -111,6 +113,10 @@ static GOptionEntry options[] = {
 	{ "debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG,
 				G_OPTION_ARG_CALLBACK, parse_debug,
 				"Specify debug options to enable", "DEBUG" },
+	{ "plugin", 'p', 0, G_OPTION_ARG_STRING, &option_plugin,
+				"Specify plugins to load", "NAME" },
+	{ "noplugin", 'P', 0, G_OPTION_ARG_STRING, &option_noplugin,
+				"Specify plugins not to load", "NAME" },
 	{ "nodetach", 'n', G_OPTION_FLAG_REVERSE,
 				G_OPTION_ARG_NONE, &option_detach,
 				"Don't run as daemon in background" },
@@ -222,7 +228,10 @@ int main(int argc, char **argv)
 
 	__ofono_manager_init();
 
-	__ofono_plugin_init(NULL, NULL);
+	__ofono_plugin_init(option_plugin, option_noplugin);
+
+	g_free(option_plugin);
+	g_free(option_noplugin);
 
 	g_main_loop_run(event_loop);
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] Add support to enable/disable specific plugin
  2010-09-11  8:58 ` [PATCH 1/1] Add support to enable/disable specific plugin Zhenhua Zhang
@ 2010-09-11 10:42   ` Marcel Holtmann
  2010-09-11 10:53     ` Zhang, Zhenhua
  0 siblings, 1 reply; 4+ messages in thread
From: Marcel Holtmann @ 2010-09-11 10:42 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]

Hi Zhenhua,

> Support to load or not load specific plugin when ofono is started.
> E.g., use 'ofonod -P hfp' to disable hfp plugin.
> ---
>  src/main.c |   11 ++++++++++-
>  1 files changed, 10 insertions(+), 1 deletions(-)

patch has been applied. I did all the hard work - just forgot to hook it
up properly ;)
 
> -	__ofono_plugin_init(NULL, NULL);
> +	__ofono_plugin_init(option_plugin, option_noplugin);
> +
> +	g_free(option_plugin);
> +	g_free(option_noplugin);

Please also send a ConnMan patch to fix the memory leak that ConnMan has
here actually.

Regards

Marcel



^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 1/1] Add support to enable/disable specific plugin
  2010-09-11 10:42   ` Marcel Holtmann
@ 2010-09-11 10:53     ` Zhang, Zhenhua
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Zhenhua @ 2010-09-11 10:53 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 944 bytes --]

Hi Holtmann,

Marcel Holtmann wrote:
> Hi Zhenhua,
> 
>> Support to load or not load specific plugin when ofono is started.
>> E.g., use 'ofonod -P hfp' to disable hfp plugin.
>> ---
>>  src/main.c |   11 ++++++++++-
>>  1 files changed, 10 insertions(+), 1 deletions(-)
> 
> patch has been applied. I did all the hard work - just forgot to hook
> it up properly ;)

Thanks.

>> -	__ofono_plugin_init(NULL, NULL);
>> +	__ofono_plugin_init(option_plugin, option_noplugin); +
>> +	g_free(option_plugin);
>> +	g_free(option_noplugin);
> 
> Please also send a ConnMan patch to fix the memory leak that ConnMan
> has here actually.

ConnMan does free the string propertly. So we don't need more fixes. :-)

Regards,
Zhenhua

> Regards
> 
> Marcel
> 
> 
> _______________________________________________
> ofono mailing list
> ofono(a)ofono.org
> http://lists.ofono.org/listinfo/ofono



Regards,
Zhenhua


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-09-11 10:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-11  8:58 [PATCH 0/1] To load/not load specific plugin at start up Zhenhua Zhang
2010-09-11  8:58 ` [PATCH 1/1] Add support to enable/disable specific plugin Zhenhua Zhang
2010-09-11 10:42   ` Marcel Holtmann
2010-09-11 10:53     ` Zhang, Zhenhua

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.