[lxc-devel] [PATCH RFC] get rid of '${lxcpath}_anon' idea

Stéphane Graber stgraber at ubuntu.com
Mon Oct 21 23:38:15 UTC 2013


On Mon, Oct 21, 2013 at 06:44:03PM -0500, Serge Hallyn wrote:
> (RFC, but I susepct everyone is in full agreement)
> 
> The idea was simply misguided.
> 
> If you provide a custom configuration file, you still should be
> putting the command sock into the real lxcpath, not an 'anon' one.
> 
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>

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

> ---
>  src/lxc/lxc_start.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/src/lxc/lxc_start.c b/src/lxc/lxc_start.c
> index a894513..2e3c3b3 100644
> --- a/src/lxc/lxc_start.c
> +++ b/src/lxc/lxc_start.c
> @@ -153,7 +153,6 @@ int main(int argc, char *argv[])
>  	};
>  	FILE *pid_fp = NULL;
>  	struct lxc_container *c;
> -	char *anonpath;
>  
>  	lxc_list_init(&defines);
>  
> @@ -172,8 +171,8 @@ int main(int argc, char *argv[])
>  			 my_args.progname, my_args.quiet, my_args.lxcpath[0]))
>  		return err;
>  
> -	anonpath = alloca(strlen(LXCPATH) + 6);
> -	sprintf(anonpath, "%s_anon", LXCPATH);
> +	const char *lxcpath = my_args.lxcpath[0];
> +
>  	/*
>  	 * rcfile possibilities:
>  	 * 1. rcfile from random path specified in cli option
> @@ -183,7 +182,7 @@ int main(int argc, char *argv[])
>  	/* rcfile is specified in the cli option */
>  	if (my_args.rcfile) {
>  		rcfile = (char *)my_args.rcfile;
> -		c = lxc_container_new(my_args.name, anonpath);
> +		c = lxc_container_new(my_args.name, lxcpath);
>  		if (!c) {
>  			ERROR("Failed to create lxc_container");
>  			return err;
> @@ -195,7 +194,6 @@ int main(int argc, char *argv[])
>  		}
>  	} else {
>  		int rc;
> -		const char *lxcpath = my_args.lxcpath[0];
>  
>  		rc = asprintf(&rcfile, "%s/%s/config", lxcpath, my_args.name);
>  		if (rc == -1) {
> @@ -208,7 +206,6 @@ int main(int argc, char *argv[])
>  		if (access(rcfile, F_OK)) {
>  			free(rcfile);
>  			rcfile = NULL;
> -			lxcpath = anonpath;
>  		}
>  		c = lxc_container_new(my_args.name, lxcpath);
>  		if (!c) {
> -- 
> 1.8.3.2
> 
> 
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/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: 836 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20131021/02d37717/attachment.pgp>


More information about the lxc-devel mailing list