[lxc-devel] [PATCH] Call dbus_threads_init_default before doing any other dbus calls

Serge Hallyn serge.hallyn at ubuntu.com
Thu Mar 6 05:06:14 UTC 2014


Quoting S.Çağlar Onur (caglar at 10ur.org):
> Otherwise concurrent start/stop operations fails
> 
> Signed-off-by: S.Çağlar Onur <caglar at 10ur.org>

I believe you nacked this yourself in the other thread right?

> ---
>  src/lxc/cgmanager.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/lxc/cgmanager.c b/src/lxc/cgmanager.c
> index e7407d8..b4abb47 100644
> --- a/src/lxc/cgmanager.c
> +++ b/src/lxc/cgmanager.c
> @@ -94,6 +94,10 @@ static void cgm_dbus_disconnect(void)
>  #define CGMANAGER_DBUS_SOCK "unix:path=/sys/fs/cgroup/cgmanager/sock"
>  static bool do_cgm_dbus_connect(void)
>  {
> +	// D-Bus will do locking, at some cost in efficiency.
> +	if (!dbus_threads_init_default())
> +		SYSERROR("dbus_threads_init_default failed");
> +
>  	DBusError dbus_error;
>  	dbus_error_init(&dbus_error);
>  
> -- 
> 1.8.3.2
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel


More information about the lxc-devel mailing list