Re: [lxc-devel] [Lxc-users] [PATCH] ignore non-lxc configuration line

2011-05-14 Thread David Serrano
On Sat, May 14, 2011 at 00:15, Serge Hallyn  wrote:
>
> I'm curious, whatcha got in mind?

I don't think you have to have something in mind to implement this.
Just that old motto "Be lenient in what you accept" :).


--
David Serrano

--
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


Re: [lxc-devel] [Lxc-users] [PATCH] ignore non-lxc configuration line

2011-05-14 Thread Serge Hallyn
Quoting Daniel Lezcano (dlezc...@fr.ibm.com):
> From: Daniel Lezcano 
> 
> We ignore the line of in the configuration file not beginning by "lxc."
> So we can mix the configuration file with another information used for
> another component through the lxc library.
> 
> Signed-off-by: Daniel Lezcano 

Acked-by: Serge Hallyn 

I'm curious, whatcha got in mind?

> ---
>  src/lxc/confile.c |   12 
>  1 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/src/lxc/confile.c b/src/lxc/confile.c
> index 791f04f..d632404 100644
> --- a/src/lxc/confile.c
> +++ b/src/lxc/confile.c
> @@ -799,7 +799,7 @@ static int parse_line(char *buffer, void *data)
>   char *dot;
>   char *key;
>   char *value;
> - int ret = -1;
> + int ret = 0;
>  
>   if (lxc_is_line_empty(buffer))
>   return 0;
> @@ -815,10 +815,14 @@ static int parse_line(char *buffer, void *data)
>   }
>  
>   line += lxc_char_left_gc(line, strlen(line));
> - if (line[0] == '#') {
> - ret = 0;
> +
> + /* martian option - ignoring it, the commented lines beginning by '#'
> +  * fall in this case
> +  */
> + if (strncmp(line, "lxc.", 4))
>   goto out;
> - }
> +
> + ret = -1;
>  
>   dot = strstr(line, "=");
>   if (!dot) {
> -- 
> 1.7.1
> 
> 
> --
> Achieve unprecedented app performance and reliability
> What every C/C++ and Fortran developer should know.
> Learn how Intel has extended the reach of its next-generation tools
> to help boost performance applications - inlcuding clusters.
> http://p.sf.net/sfu/intel-dev2devmay
> ___
> Lxc-users mailing list
> lxc-us...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users

--
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


Re: [lxc-devel] [Lxc-users] [PATCH] ignore non-lxc configuration line

2011-05-14 Thread Serge Hallyn
Quoting David Serrano (dserra...@gmail.com):
> On Sat, May 14, 2011 at 00:15, Serge Hallyn  
> wrote:
> >
> > I'm curious, whatcha got in mind?
> 
> I don't think you have to have something in mind to implement this.
> Just that old motto "Be lenient in what you accept" :).

So if I type 'lcx.' instead of 'lxc.', as I often do, it'll silently
ignore it?  No, that's a bad idea.

In any case I wasn't (until now) doubting Daniel's motivations, rather
I was pretty sure he had something neat in mind.

-serge

--
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel