[lxc-devel] [PATCH 1/1] cgm_destroy: ignore a NULL d->cgroup_path

Stéphane Graber stgraber at ubuntu.com
Mon Mar 10 17:02:08 UTC 2014


On Mon, Mar 10, 2014 at 11:59:08AM -0500, Serge Hallyn wrote:
> Depending on where during container creation we failed, cgroup_path
> may be NULL.  Don't try to delete the cgroup in that case.
> 
> (Also fix a wrong function name in an ERROR message)
> 
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>

Acked-by: Stéphane Graber <stgraber at ubuntu.com>

> ---
>  src/lxc/cgmanager.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/lxc/cgmanager.c b/src/lxc/cgmanager.c
> index c80a136..4795da4 100644
> --- a/src/lxc/cgmanager.c
> +++ b/src/lxc/cgmanager.c
> @@ -438,7 +438,7 @@ static void cgm_destroy(void *hdata)
>  	struct cgm_data *d = hdata;
>  	int i;
>  
> -	if (!d)
> +	if (!d || !d->cgroup_path)
>  		return;
>  	if (!cgm_dbus_connect()) {
>  		ERROR("Error connecting to cgroup manager");
> @@ -703,7 +703,7 @@ static int cgm_do_set(const char *controller, const char *file,
>  	if (ret != 0) {
>  		NihError *nerr;
>  		nerr = nih_error_get();
> -		ERROR("call to cgmanager_remove_sync failed: %s", nerr->message);
> +		ERROR("call to cgmanager_set_value_sync failed: %s", nerr->message);
>  		nih_free(nerr);
>  		ERROR("Error setting cgroup %s limit %s", file, cgroup);
>  	}
> -- 
> 1.9.0
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140310/3db3cce5/attachment.pgp>


More information about the lxc-devel mailing list