[PATCH weston 1/3] compositor: Make --modules always override other module loading

Kristian Høgsberg hoegsberg at gmail.com
Tue Jul 9 14:16:58 PDT 2013


On Tue, Jul 09, 2013 at 12:12:48PM +0100, Rob Bradford wrote:
> From: Rob Bradford <rob at linux.intel.com>
> 
> This allows the test suite to strictly control the modules that get
> loaded by the compositor.

The idea is that the command line option should allow loading
additional modules to what's configured in weston.ini.  For example,
the setting in weston.ini could list the shell in use, and then on the
command line you can additionally specify that you want to also load
xwayland.so or remote-server.so.

The problem is that the shell module is special and we can't load
multiple shells at the same time.  We used to have shell broken out as
a separate config option, maybe we should go back to that.  That way,
we can also add a --shell option which can properly override the shell
choice.

Kristian

> https://bugs.freedesktop.org/show_bug.cgi?id=57636
> ---
>  man/weston.man   |  3 ++-
>  src/compositor.c | 11 +++++++----
>  2 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/man/weston.man b/man/weston.man
> index 39d854b..04db1ec 100644
> --- a/man/weston.man
> +++ b/man/weston.man
> @@ -128,7 +128,8 @@ instead of writing them to stderr.
>  Load the comma-separated list of modules. Only used by the test
>  suite. The file is searched for in
>  .IR "__weston_modules_dir__" ,
> -or you can pass an absolute path.
> +or you can pass an absolute path. This overrides the loading of modules from
> +the weston.ini file.
>  .TP
>  \fB\-\^S\fR\fIname\fR, \fB\-\-socket\fR=\fIname\fR
>  Weston will listen in the Wayland socket called
> diff --git a/src/compositor.c b/src/compositor.c
> index 92d89a7..6dfa01e 100644
> --- a/src/compositor.c
> +++ b/src/compositor.c
> @@ -3350,10 +3350,13 @@ int main(int argc, char *argv[])
>  
>  	setenv("WAYLAND_DISPLAY", socket_name, 1);
>  
> -	if (load_modules(ec, modules, &argc, argv) < 0)
> -		goto out;
> -	if (load_modules(ec, option_modules, &argc, argv) < 0)
> -		goto out;
> +	if (option_modules) {
> +		if (load_modules(ec, option_modules, &argc, argv) < 0)
> +			goto out;
> +	} else {
> +		if (load_modules(ec, modules, &argc, argv) < 0)
> +			goto out;
> +	}
>  
>  	for (i = 1; i < argc; i++)
>  		weston_log("fatal: unhandled option: %s\n", argv[i]);
> -- 
> 1.8.3.1
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list