Re: [lxc-devel] [PATCH 1/3] lxc-start: fix the container leak when daemonize

2014-01-23 Thread Qiang Huang
On 2014/1/24 1:17, Serge Hallyn wrote: Quoting Qiang Huang (h.huangqi...@huawei.com): I already reasoned in the added comment, we need this because if not, lxc_container won't be freed when daemon exits, and PID file won't be unlinked either. I see, but What about this: From

Re: [lxc-devel] [PATCH] cgroup.c: clean up for handle_cgroup_settings

2014-01-22 Thread Qiang Huang
Ping... Hi Serge or Stéphane, Did you miss this? On 2014/1/20 16:37, Qiang Huang wrote: Clean up the nesting if, make the logic similar for memory and cpuset, and the error message should sent from inside, for better extendibility. Signed-off-by: Qiang Huang h.huangqi...@huawei.com

Re: [lxc-devel] [PATCH] cgroup.c: clean up for handle_cgroup_settings

2014-01-22 Thread Qiang Huang
On 2014/1/23 10:55, Serge Hallyn wrote: Quoting Qiang Huang (h.huangqi...@huawei.com): Ping... Hi Serge or Stéphane, Did you miss this? Patch looks good, Acked-by: Serge E. Hallyn serge.hal...@ubuntu.com but note that the there's been a touch of churn there. If ok with you I'll

[lxc-devel] [PATCH] cgroupfs: need the full path to setup cpuset

2014-01-22 Thread Qiang Huang
Function file_exists() needs a absolute full path, but we are using current_entire_path which is not. It will get the wrong result from file_exists() and case Segmentation fault when we fopen a non-exist file and try to fscanf from it. Signed-off-by: Qiang Huang h.huangqi...@huawei.com --- src

Re: [lxc-devel] [PATCH 1/3] lxc-start: fix the container leak when daemonize

2014-01-22 Thread Qiang Huang
On 2014/1/23 8:27, Serge Hallyn wrote: Quoting Qiang Huang (h.huangqi...@huawei.com): When start container with daemon model, we'll have a new daemon process in lxcapi_start, whose c-numthreads is 2, inherited from his father, and his father's return and lxc_container_put won't affect son's

[lxc-devel] [PATCH] cgroupfs: get rid of the redundant error info

2014-01-22 Thread Qiang Huang
Signed-off-by: Qiang Huang h.huangqi...@huawei.com --- src/lxc/cgroup.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c index 34bf126..9513e96 100644 --- a/src/lxc/cgroup.c +++ b/src/lxc/cgroup.c @@ -976,10 +976,8 @@ struct

[lxc-devel] [PATCH 3/3] daemon: fix the wrong pid in daemon model

2014-01-21 Thread Qiang Huang
(1) exits as soon as the container is started, it's complately useless. So we write pid after daemonize, so that we'll always write the right pid to PID file. Reported-by: St��phane Graber stgra...@ubuntu.com Signed-off-by: Qiang Huang h.huangqi...@huawei.com --- src/lxc/lxc_start.c| 19

[lxc-devel] [PATCH 1/3] lxc-start: fix the container leak when daemonize

2014-01-21 Thread Qiang Huang
will leak. Actually, lxc_container_get only works for mulit-threads cases, here we did fork, and don't need to hold container count to protect anything, so just remove it. Signed-off-by: Serge Hallyn serge.hal...@ubuntu.com Signed-off-by: Qiang Huang h.huangqi...@huawei.com --- src/lxc/lxccontainer.c

[lxc-devel] [PATCH 2/3] lxc-start: store PID file to lxc_container

2014-01-21 Thread Qiang Huang
So we can remove PID file untill lxc_container_free. This also fix bug: https://github.com/lxc/lxc/issues/89 Signed-off-by: Qiang Huang h.huangqi...@huawei.com --- src/lxc/lxc_start.c| 9 + src/lxc/lxccontainer.c | 7 +++ src/lxc/lxccontainer.h | 6 ++ 3 files changed, 18

Re: [lxc-devel] [PATCH 2/2] daemon: remove pidfile when daemon container is stopped

2014-01-20 Thread Qiang Huang
Hi Stéphane, On 2014/1/21 0:07, Stéphane Graber wrote: On Mon, Jan 20, 2014 at 03:22:31PM +0800, Qiang Huang wrote: On 2014/1/19 8:57, Stéphane Graber wrote: On Sat, Jan 18, 2014 at 03:00:00PM +0800, Qiang Huang wrote: This is for bug: https://github.com/lxc/lxc/issues/89 When start

Re: [lxc-devel] [PATCH 2/2] daemon: remove pidfile when daemon container is stopped

2014-01-20 Thread Qiang Huang
On 2014/1/21 11:20, Stéphane Graber wrote: On Tue, Jan 21, 2014 at 10:54:50AM +0800, Qiang Huang wrote: Hi Stéphane, I'm not sure I understand this. In my understanding, anything using the API to control an already running backgrounded container will use lxc_container_new to create a new

Re: [lxc-devel] [PATCH RFC] api_start: don't get a container reference for the daemonized case

2014-01-19 Thread Qiang Huang
On 2014/1/20 2:17, Serge Hallyn wrote: In the daemonized case we will fork, so the anonymous container memlock will not be shared between parent and child. I'm basically agree with this patch. And I'm also confused about why we need this lxc_container_get in the first place. Seems like it only

[lxc-devel] [PATCH 2/2] daemon: remove pidfile when daemon container is stopped

2014-01-17 Thread Qiang Huang
-by: Qiang Huang h.huangqi...@huawei.com --- src/lxc/lxc_start.c| 9 + src/lxc/lxccontainer.c | 6 ++ src/lxc/lxccontainer.h | 6 ++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/lxc/lxc_start.c b/src/lxc/lxc_start.c index d5379da..fd2dc6e 100644 --- a/src

Re: [lxc-devel] Dropping lxc-checkpoint and lxc-restart

2014-01-16 Thread Qiang Huang
On 2014/1/17 9:19, Stéphane Graber wrote: I just noticed that we still have lxc-checkpoint and lxc-restart in the upstream branch, as far as I know those two only work with patched kernel using a patchset which hasn't been updated in ages. I'd recommend we get those two tools out of our

Re: [lxc-devel] [PATCH] exclude non-existing signals from the loop

2014-01-16 Thread Qiang Huang
On 2014/1/17 5:38, Serge Hallyn wrote: Quoting S.Çağlar Onur (cag...@10ur.org): On Thu, Jan 16, 2014 at 4:24 PM, Serge Hallyn serge.hal...@ubuntu.com wrote: Quoting S.Çağlar Onur (cag...@10ur.org): 32 and 33 are not defined and causing sigaction to fail. kill -l shows following on my

[lxc-devel] [PATCH 2/2] cgroup.h: unify the nameing and comments

2014-01-15 Thread Qiang Huang
From: Qiang Huang h.huangqi...@huawei.com Signed-off-by: Qiang Huang h.huangqi...@huawei.com --- src/lxc/cgroup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/cgroup.h b/src/lxc/cgroup.h index 3aab12d..a252123 100644 --- a/src/lxc/cgroup.h +++ b/src/lxc/cgroup.h

[lxc-devel] [PATCH 1/2] cgroup.c: add static keywords as they declared

2014-01-15 Thread Qiang Huang
From: Qiang Huang h.huangqi...@huawei.com Signed-off-by: Qiang Huang h.huangqi...@huawei.com --- src/lxc/cgroup.c | 47 +-- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c index 6d837f9..8030a8b

[lxc-devel] [PATCH] lxc_init.c: error handing for sigaction and sigprocmask

2014-01-15 Thread Qiang Huang
Look through all LXC code and seems like only here are missed. Signed-off-by: Qiang Huang h.huangqi...@huawei.com --- Maybe this bug can be marked resolved: https://github.com/lxc/lxc/issues/83 --- src/lxc/lxc_init.c | 46 +++--- 1 file changed, 31

[lxc-devel] [PATCH] lxccontainer.c: check lxc_conf before referance haltsignal

2014-01-14 Thread Qiang Huang
, a simple check would fix this. Signed-off-by: Qiang Huang h.huangqi...@huawei.com --- src/lxc/lxccontainer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 8462ba5..0bebdff 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc

[lxc-devel] [PATCH] cgroup.c: redefine the valid cgroup name

2014-01-14 Thread Qiang Huang
Signed-off-by: Qiang Huang h.huangqi...@huawei.com --- src/lxc/cgroup.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c index 6d837f9..69910cc 100644 --- a/src/lxc/cgroup.c +++ b/src/lxc/cgroup.c @@ -1669,7 +1669,11 @@ bool

Re: [lxc-devel] [PATCH] configure.ac: add docbook-to-man to dbparsers

2014-01-07 Thread Qiang Huang
On 2014/1/7 16:07, KATOH Yasufumi wrote: Hi, On Mon, 6 Jan 2014 20:00:29 +0800 in message Re: [lxc-devel] [PATCH] configure.ac: add docbook-to-man to dbparsers Qiang Huang-san wrote: This patch works fine for ja man page in my box, do you get any real error

Re: [lxc-devel] [PATCH] configure.ac: add docbook-to-man to dbparsers

2014-01-06 Thread Qiang Huang
Hi KATON, On 2014/1/6 18:14, KATOH Yasufumi wrote: Hi, On Mon, 6 Jan 2014 10:53:15 +0800 in message [lxc-devel] [PATCH] configure.ac: add docbook-to-man to dbparsers Qiang Huang-san wrote: Debian and Ubuntu uses docbook2x-man, but some other distr like suse

[lxc-devel] [PATCH] configure.ac: add docbook-to-man to dbparsers

2014-01-05 Thread Qiang Huang
Debian and Ubuntu uses docbook2x-man, but some other distr like suse uses docbook-to-man. I think all of them should work on LXC. Signed-off-by: Qiang Huang h.huangqi...@huawei.com --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac

[lxc-devel] [PATCH] lxc-start-ephemeral: fix the man page

2014-01-05 Thread Qiang Huang
Signed-off-by: Qiang Huang h.huangqi...@huawei.com --- doc/lxc-start-ephemeral.sgml.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/lxc-start-ephemeral.sgml.in b/doc/lxc-start-ephemeral.sgml.in index 46e0592..d37ecf5 100644 --- a/doc/lxc-start-ephemeral.sgml.in +++ b/doc/lxc-start