Re: [lxc-devel] LXC live migrate

2013-11-26 Thread Qiang Huang
On 2013/11/27 0:19, Marian Marinov wrote: > > On my test setup it works for processes like apache, dovecot and mysql. > > However it does not work with containers: > > root@s321:~# criu dump -D deb1 -t 19332 --file-locks > (00.004962) Error (namespaces.c:155): Can't dump nested pid namespace for

[lxc-devel] [PATCH] lxc_user_nic: remove duplicate code

2013-11-07 Thread Qiang Huang
It's a duplicate of util.h. Signed-off-by: Qiang Huang --- src/lxc/lxc_user_nic.c | 20 1 file changed, 20 deletions(-) diff --git a/src/lxc/lxc_user_nic.c b/src/lxc/lxc_user_nic.c index dc35e55..e4f59fa 100644 --- a/src/lxc/lxc_user_nic.c +++ b/src/lxc/lxc_user_

[lxc-devel] [PATCH 1/2] utils: move remove_trailing_slashes to utils

2013-09-24 Thread Qiang Huang
Signed-off-by: Qiang Huang --- src/lxc/lxccontainer.c | 7 --- src/lxc/utils.c| 7 +++ src/lxc/utils.h| 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index ea5a84e..f5d41b3 100644 --- a/src/lxc

[lxc-devel] [PATCH 2/2] arguments: remove trailing slashes for the input lxcpath

2013-09-24 Thread Qiang Huang
which is wrong, because we combine a wrong sock name. To fix this, just remove trailing slashes when parsing arguments. Signed-off-by: Qiang Huang --- src/lxc/arguments.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lxc/arguments.c b/src/lxc/arguments.c index c35dfd8..adcf8fe 10064

Re: [lxc-devel] [PATCH] Parse: add error info when parse config failed

2013-09-23 Thread Qiang Huang
ping. Hi Serge or Stéphane, What do you think about this patch? Spell error happens in our config file(many times for me :( ), and this error info will really save user's time to figure out the problem. On 2013/9/16 10:04, Qiang Huang wrote: > When callback of one config line fail, we&

Re: [lxc-devel] [PATCH] lxc-create: conside create succeed when container is already created

2013-09-21 Thread Qiang Huang
On 2013/9/17 21:41, Serge Hallyn wrote: > Quoting Qiang Huang (h.huangqi...@huawei.com): >> On 2013/9/17 11:27, Serge Hallyn wrote: >>> Quoting Qiang Huang (h.huangqi...@huawei.com): >>>> On 2013/9/16 12:23, Stéphane Graber wrote: >>>>> On Mon, Sep 16

Re: [lxc-devel] [PATCH] lxc-create: conside create succeed when container is already created

2013-09-16 Thread Qiang Huang
On 2013/9/17 11:27, Serge Hallyn wrote: > Quoting Qiang Huang (h.huangqi...@huawei.com): >> On 2013/9/16 12:23, Stéphane Graber wrote: >>> On Mon, Sep 16, 2013 at 11:37:02AM +0800, Qiang Huang wrote: >>>> Sometimes we use: >>>> lxc-create -n xxx -f config

Re: [lxc-devel] [PATCH] lxc-create: conside create succeed when container is already created

2013-09-15 Thread Qiang Huang
On 2013/9/16 12:23, Stéphane Graber wrote: > On Mon, Sep 16, 2013 at 11:37:02AM +0800, Qiang Huang wrote: >> Sometimes we use: >> lxc-create -n xxx -f config >> to copy config to the default lxcpath with the rootfs already >> exist. >> But we will get error righ

[lxc-devel] [PATCH] lxc-create: conside create succeed when container is already created

2013-09-15 Thread Qiang Huang
Sometimes we use: lxc-create -n xxx -f config to copy config to the default lxcpath with the rootfs already exist. But we will get error right now, so fix this. Signed-off-by: Qiang Huang --- src/lxc/lxccontainer.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a

[lxc-devel] [PATCH] Parse: add error info when parse config failed

2013-09-15 Thread Qiang Huang
When callback of one config line fail, we'd better give the exactly info to help users locate the misconfig. Signed-off-by: Qiang Huang --- src/lxc/parse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lxc/parse.c b/src/lxc/parse.c index 26cbbdd..dca808d 1

[lxc-devel] [PATCH] cgroup: add bdev.h to fix the build error

2013-09-14 Thread Qiang Huang
: Qiang Huang --- src/lxc/cgroup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c index 876c60c..9417e77 100644 --- a/src/lxc/cgroup.c +++ b/src/lxc/cgroup.c @@ -44,6 +44,7 @@ #include "list.h" #include "conf.h" #include "u

Re: [lxc-devel] 0.9.x versions before 1.0

2013-07-10 Thread Qiang Huang
On 2013/7/10 22:30, Serge Hallyn wrote: > Quoting Qiang Huang (h.huangqi...@huawei.com): >> On 2013/7/10 6:05, Dwight Engen wrote: >>> Hi guys, >>> >>> Just curious, has there been any thought about doing any more lxc versions >>> 0.9.x before lxc

Re: [lxc-devel] 0.9.x versions before 1.0

2013-07-09 Thread Qiang Huang
On 2013/7/10 6:05, Dwight Engen wrote: > Hi guys, > > Just curious, has there been any thought about doing any more lxc versions > 0.9.x before lxc 1.0? Seems like a few things have accumulated since 0.9.0. > Just pulled this out of git for perspective: > > Name Commits Diffstat > 0.7.01

Re: [lxc-devel] [PATCH RFC] introduce lxc.cap.keep

2013-07-02 Thread Qiang Huang
On 2013/7/3 13:19, Serge Hallyn wrote: > Quoting Qiang Huang (h.huangqi...@huawei.com): >> On 2013/7/3 11:23, Serge Hallyn wrote: >>> Quoting Serge Hallyn (serge.hal...@ubuntu.com): >>>> The lxc configuration file currently supports 'lxc.cap.drop', a list o

Re: [lxc-devel] [PATCH RFC] introduce lxc.cap.keep

2013-07-02 Thread Qiang Huang
On 2013/7/3 11:23, Serge Hallyn wrote: > Quoting Serge Hallyn (serge.hal...@ubuntu.com): >> The lxc configuration file currently supports 'lxc.cap.drop', a list of >> capabilities to be dropped (using the bounding set) from the container. >> The problem with this is that over time new capabilities

[lxc-devel] [PATCH] lxc-execute: allow lxc-init to log only when we have a valid log level

2013-06-07 Thread Qiang Huang
Right now if we use lxc-execute without log level set, we get error: lxc: invalid log priority NOTSET. Because we set log level manually in execute_start(), but didn't check if we have a valid log level or not, so fix it. Signed-off-by: Qiang Huang --- src/lxc/execute.c

[lxc-devel] [PATCH 2/3] lxc-create: fix the typo in help info

2013-06-02 Thread Qiang Huang
Fix typo in help info of lxc-create, and get rid of duplicate comments in bdev.h Signed-off-by: Qiang Huang --- src/lxc/bdev.h | 2 +- src/lxc/lxc_create.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/bdev.h b/src/lxc/bdev.h index 7b60d95..4f27ea9 100644

[lxc-devel] [PATCH 1/3] arguments: should return negative number when error happens

2013-06-02 Thread Qiang Huang
We should return -ENOMEM instead of ENOMEM when realloc fails. Signed-off-by: Qiang Huang --- src/lxc/arguments.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/arguments.c b/src/lxc/arguments.c index 5f1c1af..8a8d306 100644 --- a/src/lxc/arguments.c +++ b/src/lxc

[lxc-devel] [PATCH 3/3] lxc-destroy: fix the wrong help info of lxc-destroy

2013-06-02 Thread Qiang Huang
Signed-off-by: Qiang Huang --- src/lxc/lxc_destroy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/lxc_destroy.c b/src/lxc/lxc_destroy.c index 686b303..07c7408 100644 --- a/src/lxc/lxc_destroy.c +++ b/src/lxc/lxc_destroy.c @@ -50,7 +50,7 @@ static struct

Re: [lxc-devel] build error of utils.h

2013-05-30 Thread Qiang Huang
Please ignore it, there might be something wrong with my box, no code's bad. Sorry for the bother. On 2013/5/30 15:40, Qiang Huang wrote: > Hi, > > I just updated to the latest code and met a build error: > > utils.h:52: error: static declaration of ‘setns’ follows non-s

[lxc-devel] build error of utils.h

2013-05-30 Thread Qiang Huang
Hi, I just updated to the latest code and met a build error: utils.h:52: error: static declaration of ‘setns’ follows non-static declaration /usr/local/include/bits/sched.h:93: note: previous declaration of ‘setns’ was here make[3]: *** [liblxc_so-bdev.o] Error 1 latest commit is 39dc698cb4025

Re: [lxc-devel] Failed to remove cgroup when lxc-start failed

2013-05-29 Thread Qiang Huang
On 2013/5/29 21:47, Serge Hallyn wrote: > > Right, so other failures later on *could* still cause this. > Shall we do something like > > { > // Wait on any unterminated children > int status, ret; > while ((ret = waitpid(-1, &status, 0)) > 0); >

Re: [lxc-devel] Failed to remove cgroup when lxc-start failed

2013-05-29 Thread Qiang Huang
On 2013/5/24 20:49, Serge Hallyn wrote: > Quoting Qiang Huang (h.huangqi...@huawei.com): >> Hi, >> >> I found a tricky problem in LXC, once I made a mistake in config, set >> >> lxc.cgroup.cpuset.cpus = -1 >> >> ofcourse start would fail, but then

[lxc-devel] [PATCH] lxc-console: use fd instead of 0 in setup_tios

2013-05-27 Thread Qiang Huang
We should use the fd specified by caller. Signed-off-by: Qiang Huang --- src/lxc/lxc_console.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/lxc_console.c b/src/lxc/lxc_console.c index 820794a..688de80 100644 --- a/src/lxc/lxc_console.c +++ b/src/lxc

Re: [lxc-devel] Failed to remove cgroup when lxc-start failed

2013-05-24 Thread Qiang Huang
On 2013/5/24 20:49, Serge Hallyn wrote: > > Could you tell us exactly which version this is, and exactly how you > created the container? When I do it in ubuntu saucy (roughly 0.9.0 lxc), > the cgroup gets correctly removed. > > My lxc version is 0.9.0(latest commit e9831f83532184), host os is

[lxc-devel] Failed to remove cgroup when lxc-start failed

2013-05-24 Thread Qiang Huang
Hi, I found a tricky problem in LXC, once I made a mistake in config, set lxc.cgroup.cpuset.cpus = -1 ofcourse start would fail, but then "lxc-ls --active" showed the container is active. error message is: # lxc-start -n hq111 -f config_hq -l TRACE lxc-start: Invalid argument - write /cgroup/lx