Re: [lxc-devel] [PATCH v2 1/4] add list_all_containers(), returns defined and active containers

2013-11-05 Thread Serge Hallyn
Quoting Serge Hallyn (serge.hal...@ubuntu.com): > Quoting Dwight Engen (dwight.en...@oracle.com): > > Signed-off-by: Dwight Engen > > Hi, > > One comment below: fwiw there's no resulting error so Acked-by: Serge E. Hallyn but if you don't see any reason not to i'll pull the qsort out. > >

Re: [lxc-devel] [PATCH v2 3/4] fix leak in list_active_containers()

2013-11-05 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > Found by running the lxc-test-list test with valgrind. The names were > put into a local array, and never freed in the success case where the > caller didn't want the names returned and in the early out failure case. > > Note we don't need to check

Re: [lxc-devel] [PATCH v2 2/4] tests list: refactor and add test for list_all_containers()

2013-11-05 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > Signed-off-by: Dwight Engen Acked-by: Serge E. Hallyn > --- > src/tests/list.c | 97 > +--- > 1 file changed, 36 insertions(+), 61 deletions(-) > > diff --git a/src/tests/list.c b/src/tests/

Re: [lxc-devel] [PATCH v2 1/4] add list_all_containers(), returns defined and active containers

2013-11-05 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > Signed-off-by: Dwight Engen Hi, One comment below: > --- > src/lxc/lxccontainer.c | 97 > +++--- > src/lxc/lxccontainer.h | 10 ++ > 2 files changed, 103 insertions(+), 4 deletions(-) > > diff -

[lxc-devel] [lxc/lxc] 4012c8: Fix tests on Android

2013-11-05 Thread GitHub
Branch: refs/heads/master Home: https://github.com/lxc/lxc Commit: 4012c89148c42dc7c15809bec348746681f96edd https://github.com/lxc/lxc/commit/4012c89148c42dc7c15809bec348746681f96edd Author: Stéphane Graber Date: 2013-11-05 (Tue, 05 Nov 2013) Changed paths: M src/tests/c

Re: [lxc-devel] [RFC 1/2] create_run_template: tell the template what caller's uid was mapped to

2013-11-05 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > On Tue, Nov 05, 2013 at 02:14:33PM -0600, Serge Hallyn wrote: > > conf.c/conf.h: have replaced bool hostid_is_mapped() with int > > mapped_hostid() > >which returns the mapped uid for the caller's uid on the host, or -1 if > >none > > > > c

Re: [lxc-devel] [RFC 2/2] lxc-user-nic: rename nic inside container to desired name

2013-11-05 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > On Tue, Nov 05, 2013 at 02:15:00PM -0600, Serge Hallyn wrote: > > To do so we do a quick setns into the container's netns. This > > (unexpectedly) turns out cleaner than trying to rename it from > > lxc_setup(), because we don't know the original ni

Re: [lxc-devel] [RFC 2/2] lxc-user-nic: rename nic inside container to desired name

2013-11-05 Thread Stéphane Graber
On Tue, Nov 05, 2013 at 02:15:00PM -0600, Serge Hallyn wrote: > To do so we do a quick setns into the container's netns. This > (unexpectedly) turns out cleaner than trying to rename it from > lxc_setup(), because we don't know the original nic name in > the container until we created it which we

Re: [lxc-devel] [RFC 1/2] create_run_template: tell the template what caller's uid was mapped to

2013-11-05 Thread Stéphane Graber
On Tue, Nov 05, 2013 at 02:14:33PM -0600, Serge Hallyn wrote: > conf.c/conf.h: have replaced bool hostid_is_mapped() with int mapped_hostid() >which returns the mapped uid for the caller's uid on the host, or -1 if >none > > create_run_template: pass caller's uid into template. > > lxc-ub

Re: [lxc-devel] [RFC 0/2] Enabling unprivileged containers

2013-11-05 Thread Stéphane Graber
On Tue, Nov 05, 2013 at 02:12:58PM -0600, Serge Hallyn wrote: > With this patchset I am able to create and run ubuntu-cloud containers > as non-root user. Note this requires an uptodate ubuntu trusty host to > get a userns-enabled kernel. The steps: > > 1. install uidmap > sudo apt-get ins

[lxc-devel] [RFC 1/2] create_run_template: tell the template what caller's uid was mapped to

2013-11-05 Thread Serge Hallyn
conf.c/conf.h: have replaced bool hostid_is_mapped() with int mapped_hostid() which returns the mapped uid for the caller's uid on the host, or -1 if none create_run_template: pass caller's uid into template. lxc-ubuntu-cloud: 1. accept --mapped-uid argument 2. don't write t

[lxc-devel] [RFC 2/2] lxc-user-nic: rename nic inside container to desired name

2013-11-05 Thread Serge Hallyn
To do so we do a quick setns into the container's netns. This (unexpectedly) turns out cleaner than trying to rename it from lxc_setup(), because we don't know the original nic name in the container until we created it which we do in the parent after the init has been cloned. Signed-off-by: Serge

[lxc-devel] [RFC 0/2] Enabling unprivileged containers

2013-11-05 Thread Serge Hallyn
With this patchset I am able to create and run ubuntu-cloud containers as non-root user. Note this requires an uptodate ubuntu trusty host to get a userns-enabled kernel. The steps: 1. install uidmap sudo apt-get install uidmap 2. make sure to have a range of allocated subuids, i.e.

[lxc-devel] [lxc/lxc] 3da0fe: Only include execinfo.h if MUTEX_DEBUGGING is set

2013-11-05 Thread GitHub
Branch: refs/heads/master Home: https://github.com/lxc/lxc Commit: 3da0feef099c7da83352525fe4930dc9f7a3df82 https://github.com/lxc/lxc/commit/3da0feef099c7da83352525fe4930dc9f7a3df82 Author: Stéphane Graber Date: 2013-11-05 (Tue, 05 Nov 2013) Changed paths: M src/lxc/uti

[lxc-devel] [PATCH v2 1/4] add list_all_containers(), returns defined and active containers

2013-11-05 Thread Dwight Engen
Signed-off-by: Dwight Engen --- src/lxc/lxccontainer.c | 97 +++--- src/lxc/lxccontainer.h | 10 ++ 2 files changed, 103 insertions(+), 4 deletions(-) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 89b45ed..d7d3273 100644 --- a/

[lxc-devel] [PATCH v2 3/4] fix leak in list_active_containers()

2013-11-05 Thread Dwight Engen
Found by running the lxc-test-list test with valgrind. The names were put into a local array, and never freed in the success case where the caller didn't want the names returned and in the early out failure case. Note we don't need to check the return from remove_from_array() because we just succe

[lxc-devel] [PATCH v2 4/4] add statistics to lxc-info

2013-11-05 Thread Dwight Engen
- allow lxc-info to show more than one container, using regex for the name Signed-off-by: Dwight Engen --- doc/lxc-info.sgml.in | 65 - src/lxc/lxc_info.c | 257 +++ 2 files changed, 300 insertions(+), 22 deletions(-) diff --git a/d

[lxc-devel] [PATCH v2 2/4] tests list: refactor and add test for list_all_containers()

2013-11-05 Thread Dwight Engen
Signed-off-by: Dwight Engen --- src/tests/list.c | 97 +--- 1 file changed, 36 insertions(+), 61 deletions(-) diff --git a/src/tests/list.c b/src/tests/list.c index a061542..af41e7f 100644 --- a/src/tests/list.c +++ b/src/tests/list.c @@ -21,90

[lxc-devel] [PATCH v2 0/4] add statistics to lxc-info

2013-11-05 Thread Dwight Engen
Hi Stéphane, I was able to add the ***containers output fairly in a fairly straightforward manner. I also split out the patch into more discrete logical changes, adding/refactoring the list.c test and fixing a leak in list_active_containers() along the way. Serge, hopefully you don't mind I rename

[lxc-devel] [lxc/lxc] 650200: allow lxcapi_get_cgroup_item() on lxc-execute cont...

2013-11-05 Thread GitHub
Branch: refs/heads/master Home: https://github.com/lxc/lxc Commit: 6502006a44d27a27fe1e2d9d8cac721c0ec8907a https://github.com/lxc/lxc/commit/6502006a44d27a27fe1e2d9d8cac721c0ec8907a Author: Dwight Engen Date: 2013-11-05 (Tue, 05 Nov 2013) Changed paths: M src/lxc/lxccon

[lxc-devel] [PATCH v2] fix leak when a veth.pair name is specified

2013-11-05 Thread Dwight Engen
Please do not apply the previous version of this patch, it is wrong. I didn't take into account that priv is a union, so priv.veth_attr.pair is only a pointer when netdev type is VETH. The following patch works when non-veth nics are also present. -- Signed-off-by: Dwight Engen --- src/lxc/conf

Re: [lxc-devel] [PATCH 1/1] resolve lxcpath and rcfile arguments

2013-11-05 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > On Mon, Nov 04, 2013 at 02:44:44PM -0600, Serge Hallyn wrote: > > So we don't always have to give full paths. > > > > realpath(x,NULL) mallocs memory, but these paths shouldn't get called > > from the API so not freeing should be ok. > > > > What'

Re: [lxc-devel] [PATCH 2/2] add statistics to lxc-info

2013-11-05 Thread Dwight Engen
On Mon, 4 Nov 2013 18:12:15 -0500 Stéphane Graber wrote: > On Mon, Nov 04, 2013 at 05:35:19PM -0500, Dwight Engen wrote: > > - added list_all_containers() which returns both defined and > > active containers. > > > > - allow lxc-info to show more than one container, using regex for > > the nam