Re: [lxc-devel] lxc_monitord - monitor exiting

2013-05-03 Thread S . Çağlar Onur
Hi all, I think I understand why I'm confused before while chasing another bug. This is what I'm seeing right now. * I patched lxc_monitord.c with following diff --git a/src/lxc/lxc_monitord.c b/src/lxc/lxc_monitord.c index e76af71..59f1e9d 100644 --- a/src/lxc/lxc_monitord.c +++ b/src/lxc/lxc_

Re: [lxc-devel] [PATCH 2/3] coverity: fix dereference NULL return value

2013-05-03 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > also break once we have found root, no need to search the rest of the mounts I'm not sure about this. There can be >1 entries for /. Though when I do lxc-unshare -s MOUNT -- /bin/sh mount --rbind / / mount --make-rsha

Re: [lxc-devel] [PATCH 1/3] coverity: fix dereference before NULL check

2013-05-03 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > also fixed some error strings while here > > Signed-off-by: Dwight Engen Acked-by: Serge E. Hallyn > --- > src/tests/cgpath.c | 9 - > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/src/tests/cgpath.c b/src/tests/cgp

[lxc-devel] [PATCH 1/3] coverity: fix dereference before NULL check

2013-05-03 Thread Dwight Engen
also fixed some error strings while here Signed-off-by: Dwight Engen --- src/tests/cgpath.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/tests/cgpath.c b/src/tests/cgpath.c index de2d13b..d8c3624 100644 --- a/src/tests/cgpath.c +++ b/src/tests/cgpath.c @@ -51,

[lxc-devel] [PATCH 2/3] coverity: fix dereference NULL return value

2013-05-03 Thread Dwight Engen
also break once we have found root, no need to search the rest of the mounts Signed-off-by: Dwight Engen --- src/lxc/conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 125e8a6..827626f 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.

Re: [lxc-devel] [PATCH] coverity: ftell returns a signed value

2013-05-03 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > The check for flen < 0 could never have been true since flen was declared > to be size_t (unsigned). Declare flen to be long since that is what ftell > returns. > > Signed-off-by: Dwight Engen thanks, applied > --- > src/lxc/lxccontainer.c | 2

Re: [lxc-devel] [PATCH 1/4] coverity: don't reference beyond structure

2013-05-03 Thread Dwight Engen
On Fri, 3 May 2013 12:23:29 -0500 Serge Hallyn wrote: > Quoting Dwight Engen (dwight.en...@oracle.com): > > On Fri, 3 May 2013 11:17:08 -0500 > > Serge Hallyn wrote: > > > > > can that be correct? That changes the value of the > > > pointer. NLMSG_DATA adds aligned sizeof(struct nlmsghdr). >

[lxc-devel] [PATCH] coverity: ftell returns a signed value

2013-05-03 Thread Dwight Engen
The check for flen < 0 could never have been true since flen was declared to be size_t (unsigned). Declare flen to be long since that is what ftell returns. Signed-off-by: Dwight Engen --- src/lxc/lxccontainer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/lxcconta

Re: [lxc-devel] [PATCH 1/4] coverity: don't reference beyond structure

2013-05-03 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > On Fri, 3 May 2013 11:17:08 -0500 > Serge Hallyn wrote: > > > can that be correct? That changes the value of the > > pointer. NLMSG_DATA adds aligned sizeof(struct nlmsghdr). > > The current code is relying on the fact that our genlmsg looks li

Re: [lxc-devel] [PATCH 1/4] coverity: don't reference beyond structure

2013-05-03 Thread Dwight Engen
On Fri, 3 May 2013 11:17:08 -0500 Serge Hallyn wrote: > can that be correct? That changes the value of the > pointer. NLMSG_DATA adds aligned sizeof(struct nlmsghdr). The current code is relying on the fact that our genlmsg looks like this: struct genlmsg { struct nlmsghdr nlmsghdr;

Re: [lxc-devel] [PATCH 4/4] coverity: fix leak when ipv6 gw is auto

2013-05-03 Thread Dwight Engen
On Fri, 3 May 2013 11:27:54 -0500 Serge Hallyn wrote: > Quoting Dwight Engen (dwight.en...@oracle.com): > > Signed-off-by: Dwight Engen > > Thanks. To prevent future snafus it might be worth declaring gw just > in that block, but Yeah, I just moved the use inside the block. I'm all for a styl

Re: [lxc-devel] [PATCH 2/4] coverity: ensure string is null terminated, return in error case

2013-05-03 Thread Dwight Engen
On Fri, 3 May 2013 11:25:36 -0500 Serge Hallyn wrote: > Quoting Dwight Engen (dwight.en...@oracle.com): > > >From ac0d2e143fa450fc19dd3f9330a8fed8bd4a178b Mon Sep 17 00:00:00 > > >2001 > > From: Dwight Engen > > Date: Fri, 3 May 2013 11:29:39 -0400 > > Subject: [PATCH 2/4] coverity: ensure strin

Re: [lxc-devel] [PATCH 4/4] coverity: fix leak when ipv6 gw is auto

2013-05-03 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > Signed-off-by: Dwight Engen Thanks. To prevent future snafus it might be worth declaring gw just in that block, but Acked-by: Serge E. Hallyn > --- > src/lxc/confile.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > >

Re: [lxc-devel] [PATCH 2/4] coverity: ensure string is null terminated, return in error case

2013-05-03 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > >From ac0d2e143fa450fc19dd3f9330a8fed8bd4a178b Mon Sep 17 00:00:00 2001 > From: Dwight Engen > Date: Fri, 3 May 2013 11:29:39 -0400 > Subject: [PATCH 2/4] coverity: ensure string is null terminated, return in > error case > > Signed-off-by: Dwigh

Re: [lxc-devel] [PATCH 3/4] coverity: fix leak in error case

2013-05-03 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > Since lxc_execute() is available through the library and is exposed via > the API we cannot be sure the caller will immediately exit, so we should > take care to free the allocated memory. Right, in start.c/execute.c we want to do that. In lxc_sta

Re: [lxc-devel] [PATCH 1/4] coverity: don't reference beyond structure

2013-05-03 Thread Serge Hallyn
can that be correct? That changes the value of the pointer. NLMSG_DATA adds aligned sizeof(struct nlmsghdr). I suspect lxc is doing the right thing in practice, but could do some sort of casting somewhere to tell coverity to lighten up. But I haven't yet figured out what that is. Quoting Dwigh

[lxc-devel] [PATCH 3/4] coverity: fix leak in error case

2013-05-03 Thread Dwight Engen
Since lxc_execute() is available through the library and is exposed via the API we cannot be sure the caller will immediately exit, so we should take care to free the allocated memory. Signed-off-by: Dwight Engen --- src/lxc/execute.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-)

[lxc-devel] [PATCH 4/4] coverity: fix leak when ipv6 gw is auto

2013-05-03 Thread Dwight Engen
Signed-off-by: Dwight Engen --- src/lxc/confile.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lxc/confile.c b/src/lxc/confile.c index d0a404f..fbae861 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -782,12 +782,6 @@ static int config_network_ipv

[lxc-devel] [PATCH 2/4] coverity: ensure string is null terminated, return in error case

2013-05-03 Thread Dwight Engen
>From ac0d2e143fa450fc19dd3f9330a8fed8bd4a178b Mon Sep 17 00:00:00 2001 From: Dwight Engen Date: Fri, 3 May 2013 11:29:39 -0400 Subject: [PATCH 2/4] coverity: ensure string is null terminated, return in error case Signed-off-by: Dwight Engen --- src/lxc/lxccontainer.c | 4 +++- 1 file changed,

[lxc-devel] [PATCH 1/4] coverity: don't reference beyond structure

2013-05-03 Thread Dwight Engen
Signed-off-by: Dwight Engen --- src/lxc/genl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/genl.c b/src/lxc/genl.c index 873b084..8fcb6b7 100644 --- a/src/lxc/genl.c +++ b/src/lxc/genl.c @@ -55,7 +55,7 @@ static int genetlink_resolve_family(const char *family)

Re: [lxc-devel] patches to implement -P for the lxc-* scripts

2013-05-03 Thread S . Çağlar Onur
On Fri, May 3, 2013 at 11:10 AM, Stéphane Graber wrote: > On 05/03/2013 07:37 AM, Harald Dunkel wrote: > > On 05/03/13 14:26, Serge Hallyn wrote: > >> > >> Hm, are you looking at https://github.com/lxc/lxc/tree/staging/src/lxc? > >> > > > > ??? > > > > http://lxc.sourceforge.net/index.php/about/lx

Re: [lxc-devel] [PATCH 1/4] support alternate container path in lxc-shutdown

2013-05-03 Thread Serge Hallyn
Quoting Harald Dunkel (harald.dun...@aixigo.de): > Hi Serge, > > On 05/03/13 14:16, Serge Hallyn wrote: > > Quoting Harald Dunkel (harald.dun...@aixigo.de): > >> --- > >> src/lxc/lxc-shutdown.in | 23 +++ > >> 1 file changed, 19 insertions(+), 4 deletions(-) > >> > >> diff --g

Re: [lxc-devel] patches to implement -P for the lxc-* scripts

2013-05-03 Thread Stéphane Graber
On 05/03/2013 07:37 AM, Harald Dunkel wrote: > On 05/03/13 14:26, Serge Hallyn wrote: >> >> Hm, are you looking at https://github.com/lxc/lxc/tree/staging/src/lxc ? >> > > ??? > > http://lxc.sourceforge.net/index.php/about/lxc-development/ says > to use git://lxc.git.sourceforge.net/gitroot/lxc/l

Re: [lxc-devel] patches to implement -P for the lxc-* scripts

2013-05-03 Thread Harald Dunkel
On 05/03/13 14:26, Serge Hallyn wrote: > > Hm, are you looking at https://github.com/lxc/lxc/tree/staging/src/lxc ? > ??? http://lxc.sourceforge.net/index.php/about/lxc-development/ says to use git://lxc.git.sourceforge.net/gitroot/lxc/lxc. There was no staging repository mentioned. Regards H

Re: [lxc-devel] [PATCH 1/4] support alternate container path in lxc-shutdown

2013-05-03 Thread Harald Dunkel
Hi Serge, On 05/03/13 14:16, Serge Hallyn wrote: > Quoting Harald Dunkel (harald.dun...@aixigo.de): >> --- >> src/lxc/lxc-shutdown.in | 23 +++ >> 1 file changed, 19 insertions(+), 4 deletions(-) >> >> diff --git a/src/lxc/lxc-shutdown.in b/src/lxc/lxc-shutdown.in >> index ee0

Re: [lxc-devel] [PATCH 2/2] lxc_start: free the conf if starting the container fails

2013-05-03 Thread Serge Hallyn
Quoting Weng Meiling (wengmeiling.w...@huawei.com): > > When running lxc-start command with valgrind, it reports a memory leak error. > When lxc-start command fails, the conf which is from malloc has not been > released. > This patch fix the problem. > > Signed-off-by: Weng Meiling This isn't

Re: [lxc-devel] [PATCH 1/2] add free conf->rcfile in lxc_conf_free

2013-05-03 Thread Serge Hallyn
Quoting Weng Meiling (wengmeiling.w...@huawei.com): > > when releasing the conf, add free conf->rcfile which is from malloc > > Signed-off-by: Weng Meiling Thanks. Acked-by: Serge E. Hallyn > --- > src/lxc/conf.c |2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git

Re: [lxc-devel] patches to implement -P for the lxc-* scripts

2013-05-03 Thread Serge Hallyn
Quoting Harald Dunkel (harald.dun...@aixigo.de): > Hi Serge, > > On 05/02/13 14:33, Serge Hallyn wrote: > > Quoting Harald Dunkel (harald.dun...@aixigo.de): > >> Hi folks, > >> > >> I would like to contribute patches for > >> > >>lxc-shutdown > >>lxc-clone > >>lxc-create > >>lxc-ne

Re: [lxc-devel] [PATCH 4/4] support alternate container path in lxc-netstat.in

2013-05-03 Thread Serge Hallyn
Quoting Harald Dunkel (harald.dun...@aixigo.de): > --- Acked-by: Serge E. Hallyn > src/lxc/lxc-netstat.in | 21 - > 1 file changed, 16 insertions(+), 5 deletions(-) > > diff --git a/src/lxc/lxc-netstat.in b/src/lxc/lxc-netstat.in > index 2fa2d23..d3eee1c 100644 > --- a/src/

Re: [lxc-devel] [PATCH 3/4] support alternate container path in lxc-clone.in

2013-05-03 Thread Serge Hallyn
Quoting Harald Dunkel (harald.dun...@aixigo.de): > --- > src/lxc/lxc-clone.in | 22 ++ > 1 file changed, 14 insertions(+), 8 deletions(-) lxc-clone is now provided by lxc_clone.c. (Which brings up the point: we might want to discuss maintenance of stable trees, i.e. for 0.7.

Re: [lxc-devel] [PATCH 2/4] lxc-create: add missing -P option for running lxc-destroy

2013-05-03 Thread Serge Hallyn
Quoting Harald Dunkel (harald.dun...@aixigo.de): > --- > src/lxc/lxc-create.in | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Ah yes, good catch, thanks. (Could you please add Signed-off-by: Harald Dunkel which 'git commit -s' should automatically do) Acked-by: Serge E. Hallyn

Re: [lxc-devel] [PATCH 1/4] support alternate container path in lxc-shutdown

2013-05-03 Thread Serge Hallyn
Quoting Harald Dunkel (harald.dun...@aixigo.de): > --- > src/lxc/lxc-shutdown.in | 23 +++ > 1 file changed, 19 insertions(+), 4 deletions(-) > > diff --git a/src/lxc/lxc-shutdown.in b/src/lxc/lxc-shutdown.in > index ee07f75..247e90b 100644 > --- a/src/lxc/lxc-shutdown.in > ++

Re: [lxc-devel] patches to implement -P for the lxc-* scripts

2013-05-03 Thread Harald Dunkel
Hi Serge, On 05/02/13 14:33, Serge Hallyn wrote: > Quoting Harald Dunkel (harald.dun...@aixigo.de): >> Hi folks, >> >> I would like to contribute patches for >> >> lxc-shutdown >> lxc-clone >> lxc-create >> lxc-netstat >> >> to support an alternate container directory using "-P

[lxc-devel] [PATCH 3/4] support alternate container path in lxc-clone.in

2013-05-03 Thread Harald Dunkel
--- src/lxc/lxc-clone.in | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/lxc/lxc-clone.in b/src/lxc/lxc-clone.in index 4c8acb4..8ff9947 100755 --- a/src/lxc/lxc-clone.in +++ b/src/lxc/lxc-clone.in @@ -25,7 +25,7 @@ set -e usage() { echo "usag

[lxc-devel] [PATCH 1/4] support alternate container path in lxc-shutdown

2013-05-03 Thread Harald Dunkel
--- src/lxc/lxc-shutdown.in | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/lxc/lxc-shutdown.in b/src/lxc/lxc-shutdown.in index ee07f75..247e90b 100644 --- a/src/lxc/lxc-shutdown.in +++ b/src/lxc/lxc-shutdown.in @@ -18,13 +18,17 @@ set -e +lxcp

[lxc-devel] [PATCH 2/4] lxc-create: add missing -P option for running lxc-destroy

2013-05-03 Thread Harald Dunkel
--- src/lxc/lxc-create.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/lxc-create.in b/src/lxc/lxc-create.in index ebbdd7b..970d3ff 100644 --- a/src/lxc/lxc-create.in +++ b/src/lxc/lxc-create.in @@ -269,7 +269,7 @@ cleanup() { btrfs subvolume delete "$rootfs

[lxc-devel] [PATCH 4/4] support alternate container path in lxc-netstat.in

2013-05-03 Thread Harald Dunkel
--- src/lxc/lxc-netstat.in | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/lxc/lxc-netstat.in b/src/lxc/lxc-netstat.in index 2fa2d23..d3eee1c 100644 --- a/src/lxc/lxc-netstat.in +++ b/src/lxc/lxc-netstat.in @@ -17,8 +17,10 @@ # License along with thi