Re: [lxc-devel] [PATCH 4/6] Add bdev_destroy() to bdev.c and bdev.h static do_bdev_destroy() in lxccontainer.c becomes public bdev_destroy()

2015-09-08 Thread Christian Brauner
On Mon, Sep 07, 2015 at 05:05:47PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> > > > > 100.0% src/lxc/ > > diff --git a/src/lxc/bdev.c b/src/lxc/

Re: [lxc-devel] lxc-clone rewrite

2015-09-06 Thread Christian Brauner
-ephemeral part of lxc-copy) but the function works for all bdev types supported by lxc. These commits are also present as a PR on github. Christian Brauner (6): Add lxc.ephemeral lxc.ephemeral indicates whether a container will be destroyed on shutdown Any integer value >

[lxc-devel] [PATCH 1/6] Add lxc.ephemeral lxc.ephemeral indicates whether a container will be destroyed on shutdown Any integer value > 0 can be used to indicate that a container is ephemeral.

2015-09-06 Thread Christian Brauner
Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> 100.0% src/lxc/ diff --git a/src/lxc/conf.h b/src/lxc/conf.h index dc5328a..5aebd91 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -370,6 +370,9 @@ struct lxc_conf { * should run under when using lxc-e

[lxc-devel] [PATCH 4/6] Add bdev_destroy() to bdev.c and bdev.h static do_bdev_destroy() in lxccontainer.c becomes public bdev_destroy()

2015-09-06 Thread Christian Brauner
Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> 100.0% src/lxc/ diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index ada3958..475d878 100644 --- a/src/lxc/bdev.c +++ b/src/lxc/bdev.c @@ -3614,3 +3614,21 @@ bool rootfs_is_blockdev(struct lxc_conf *conf) retur

[lxc-devel] [PATCH 5/6] Destroy bdevs using new bdev_destroy() from bdev.h

2015-09-06 Thread Christian Brauner
Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> 100.0% src/lxc/ diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 2103437..9f22fdc 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -2213,21 +2213,6 @@ static int lxc_rmdir_onedev_wrappe

[lxc-devel] [PATCH 6/6] Enable lxc_fini() to destroy container on shutdown This works for any bdev-type but is only used for overlayfs and aufs now

2015-09-06 Thread Christian Brauner
Now we can e.g. implement ephemeral containers in a consistent way. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> 100.0% src/lxc/ diff --git a/src/lxc/start.c b/src/lxc/start.c index ffb8d12..1179d2c 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -83,6 +83,11 @@

Re: [lxc-devel] [PATCH 6/6] Enable lxc_fini() to destroy container on shutdown This works for any bdev-type but is only used for overlayfs and aufs now

2015-09-06 Thread Christian Brauner
Fixes for the return value checks. On Sun, Sep 06, 2015 at 10:38:21AM +0200, Christian Brauner wrote: > Now we can e.g. implement ephemeral containers in a consistent way. > > Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> > > 100.0% src/lxc/ > diff -

Re: [lxc-devel] lxc-clone rewrite

2015-09-04 Thread Christian Brauner
On Mon, Aug 31, 2015 at 09:53:03PM +0200, Christian Brauner wrote: > On Mon Aug 31, 2015 at 04:08:33PM +, Serge Hallyn wrote: > > Quoting Stéphane Graber (stgraber at ubuntu.com): > > > On Mon, Aug 31, 2015 at 01:43:07PM +, Serge Hallyn wrote: > > >

Re: [lxc-devel] [PATCH 1/6] Add lxc.ephemeral lxc.ephemeral indicates whether a container will be destroyed on shutdown Any integer value > 0 can be used to indicate that a container is ephemeral.

2015-09-08 Thread Christian Brauner
On Mon, Sep 07, 2015 at 04:54:26PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> > > Acked-by: Serge E. Hallyn <serge.hal...@ubuntu.com> > > Tho

[lxc-devel] [PATCH] Do not use strlen() on non-null terminated buffer

2015-09-07 Thread Christian Brauner
Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/lxccontainer.c | 31 +-- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 932d658..fb99892 100644 --- a/s

[lxc-devel] [PATCH] Do not use strlen() on non-null terminated buffer

2015-09-07 Thread Christian Brauner
Serge, you should add a Suggested-by line if you want to. Christian Brauner (1): Do not use strlen() on non-null terminated buffer src/lxc/lxccontainer.c | 31 +-- 1 file changed, 17 insertions(+), 14 deletions(-) -- 2.5.1

Re: [lxc-devel] [PATCH 2/6] Delete string from array Add function to delete a string from a non-null terminated buffer

2015-09-07 Thread Christian Brauner
On Mon, Sep 07, 2015 at 05:03:37PM +, Serge Hallyn wrote: > Quoting Serge Hallyn (serge.hal...@ubuntu.com): > > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > > > I'm probably wrong, but > > > > 1. if the buffer is non-null-terminated, then ca

Re: [lxc-devel] [PATCH] Fix strlen on non-null terminated buffer strlen() becomes strnlen()

2015-09-07 Thread Christian Brauner
Sorry, forget it, that doesn't make sense... On Mon, Sep 07, 2015 at 08:38:51PM +0200, Christian Brauner wrote: > Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> > --- > src/lxc/lxccontainer.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > &

[lxc-devel] [PATCH] Fix strlen on non-null terminated buffer

2015-09-07 Thread Christian Brauner
strlen() was used a non-null terminated buffer. Use strnlen instead. Christian Brauner (1): Fix strlen on non-null terminated buffer strlen() becomes strnlen() src/lxc/lxccontainer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.5.1

[lxc-devel] [PATCH 0/4] Add lxc.ephemeral to destroy container on shutdown (v2)

2015-09-08 Thread Christian Brauner
These patches add the ability to destroy a container on shutdown when lxc.ephemeral = 1 is set in the containers config file. Tested with privileged and unprivileged btrfs-, overlayfs-, and aufs- containers on Ubuntu Wily 15.04. Christian Brauner (4): Add lxc.ephemeral lxc.ephemeral

[lxc-devel] [PATCH 1/4] Add lxc.ephemeral lxc.ephemeral indicates whether a container will be destroyed on shutdown Can be 0 for non-ephemeral and 1 for ephemeral.

2015-09-08 Thread Christian Brauner
Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/conf.h| 3 +++ src/lxc/confile.c | 20 2 files changed, 23 insertions(+) diff --git a/src/lxc/conf.h b/src/lxc/conf.h index dc5328a..5aebd91 100644 --- a/src/lxc/conf.h +++ b/src/lxc/

[lxc-devel] [PATCH 2/4] Add bdev_destroy() and bdev_destroy_wrapper()

2015-09-08 Thread Christian Brauner
static do_bdev_destroy() and bdev_destroy_wrapper() from lxccontainer.c become public bdev_destroy() and bdev_destroy_wrapper() in bdev.c and bdev.h Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/bdev.c | 39 +++ src/lxc/

[lxc-devel] [PATCH 3/4] Destroy bdevs using bdev_destroy() from bdev.h

2015-09-08 Thread Christian Brauner
Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/lxccontainer.c | 60 ++ 1 file changed, 17 insertions(+), 43 deletions(-) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index fb99892..6cc3b08

[lxc-devel] [PATCH 4/4] Enable lxc_fini() to destroy container on shutdown

2015-09-08 Thread Christian Brauner
When lxc.ephemeral is set to 1 in the containers config it will be destroyed on shutdown. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/start.c | 58 + 1 file changed, 58 insertions(+) diff --git a/s

Re: [lxc-devel] [PATCH] Add remove_snapshots_entry() (rebased - v2)

2015-09-14 Thread Christian Brauner
On Mon, Sep 14, 2015 at 03:03:58PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > When creating ephemeral containers that have the option lxc.ephemeral = 1 > > set > > in their config, they will be destroyed on shutdown. As they ar

Re: [lxc-devel] [PATCH] Add remove_snapshots_entry() (rebased - v2)

2015-09-14 Thread Christian Brauner
On Mon, Sep 14, 2015 at 02:50:39PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > When creating ephemeral containers that have the option lxc.ephemeral = 1 > > set > > in their config, they will be destroyed on shutdown. As they ar

Re: [lxc-devel] [PATCH] Add remove_snapshots_entry() (rebased - v2)

2015-09-14 Thread Christian Brauner
On Mon, Sep 14, 2015 at 02:50:39PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > When creating ephemeral containers that have the option lxc.ephemeral = 1 > > set > > in their config, they will be destroyed on shutdown. As they ar

Re: [lxc-devel] [PATCH] Add remove_snapshots_entry() (rebased - v2)

2015-09-14 Thread Christian Brauner
On Mon, Sep 14, 2015 at 08:51:08PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > On Mon, Sep 14, 2015 at 08:31:59PM +, Serge Hallyn wrote: > > > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > > > On M

Re: [lxc-devel] [PATCH] Add remove_snapshots_entry() (rebased - v2)

2015-09-14 Thread Christian Brauner
On Mon, Sep 14, 2015 at 07:27:06PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > On Mon, Sep 14, 2015 at 04:33:05PM +, Serge Hallyn wrote: > > > Quoting Serge Hallyn (serge.hal...@ubuntu.com): > > > > Quoting Chris

Re: [lxc-devel] [PATCH] Add remove_snapshots_entry() (rebased - v2)

2015-09-14 Thread Christian Brauner
On Mon, Sep 14, 2015 at 08:31:59PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > On Mon, Sep 14, 2015 at 07:27:06PM +, Serge Hallyn wrote: > > > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > > > On M

Re: [lxc-devel] [PATCH] Add remove_snapshots_entry() (rebased - v2)

2015-09-14 Thread Christian Brauner
On Mon, Sep 14, 2015 at 10:54:34PM +, Serge Hallyn wrote: > Does it help if we simply define c->delete_with_snapshot_clones(), and have > src/lxc/destroy.c use that? Then we can contain mod_all_rdeps to being a > static function in src/lxc/lxccontainer.c If not, remind me where else we >

[lxc-devel] [PATCH] Ensure that mmap()ed memory is \0-terminated (v3)

2015-09-11 Thread Christian Brauner
-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/lxccontainer.c | 70 +++--- 1 file changed, 32 insertions(+), 38 deletions(-) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index fb99892..78021b6 100644 --- a/s

[lxc-devel] [PATCH] New approach to remove container entry from lxc_snapshots (v3)

2015-09-11 Thread Christian Brauner
check if my calculations for memmove() and ftruncate() are correct.) Christian Brauner (1): Ensure that mmap()ed memory is \0-terminated (v3) Use pwrite() to write terminating \0-byte src/lxc/lxccontainer.c | 70 +++--- 1 file changed, 32

[lxc-devel] [PATCH] Add remove_snapshots_entry()

2015-09-11 Thread Christian Brauner
in start.c and lxccontainer.c? (Another step for providing a consistent rewrite of lxc-clone + lxc-start-ephemeral.) Christian Brauner (1): Add remove_snapshots_entry() src/lxc/start.c | 43 --- 1 file changed, 20 insertions(+), 23 deletions(-) -- 2.5.1

[lxc-devel] [PATCH] Add remove_snapshots_entry()

2015-09-11 Thread Christian Brauner
the lxc_snapshots file when they are destroyed. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/start.c | 43 --- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index 93c039c..f

Re: [lxc-devel] [PATCH] Ensure that mmap()ed memory is \0-terminated (v2) Use pwrite() to write terminating \0-byte

2015-09-11 Thread Christian Brauner
Updated patch to follow. On Thu, Sep 10, 2015 at 11:20:44PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > This allows us to use standard string handling functions and we can avoid > > using > > the GNU-extension memmem(). Thi

[lxc-devel] [PATCH] Add remove_snapshots_entry() (rebased - v2)

2015-09-11 Thread Christian Brauner
in start.c and lxccontainer.c? Christian Brauner (1): Add remove_snapshots_entry() src/lxc/start.c | 123 1 file changed, 123 insertions(+) -- 2.5.1 ___ lxc-devel mailing list lxc-devel

[lxc-devel] [PATCH] Add remove_snapshots_entry() (rebased - v2)

2015-09-11 Thread Christian Brauner
the lxc_snapshots file when they are destroyed. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/start.c | 123 1 file changed, 123 insertions(+) diff --git a/src/lxc/start.c b/src/lxc/start.c index 8fe08a1..f

Re: [lxc-devel] [PATCH] Add remove_snapshots_entry() (rebased - v2)

2015-09-15 Thread Christian Brauner
On Tue, Sep 15, 2015 at 12:57:26AM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > On Mon, Sep 14, 2015 at 08:51:08PM +, Serge Hallyn wrote: > > > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > > > On M

[lxc-devel] [PATCH 0/2] Remove ephemeral containers from lxc_snapshots

2015-09-15 Thread Christian Brauner
the basic functionality of lxc-start-ephemeral in C. Christian Brauner (2): Make mod_all_rdeps() public It will now also be called from start.c Remove ephemeral containers from lxc_snapshots src/lxc/lxccontainer.c | 2 +- src/lxc/start.c| 15 +++ 2 files changed, 16

[lxc-devel] [PATCH 2/2] Remove ephemeral containers from lxc_snapshots

2015-09-15 Thread Christian Brauner
On shutdown ephemeral containers will be destroyed. We use mod_all_rdeps() from lxccontainer.c to update the lxc_snapshots file of the original container. We also include lxclock.h to lock the container when mod_all_rdeps() is called to avoid races. Signed-off-by: Christian Brauner

[lxc-devel] [PATCH 1/2] Make mod_all_rdeps() public It will now also be called from start.c

2015-09-15 Thread Christian Brauner
Signed-off-by: Christian Brauner <christianvanbrau...@gmail.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 0ba4fc0..dd891dc 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxcconta

Re: [lxc-devel] [PATCH] Add remove_snapshots_entry() (rebased - v2)

2015-09-14 Thread Christian Brauner
On Mon, Sep 14, 2015 at 07:27:06PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > On Mon, Sep 14, 2015 at 04:33:05PM +, Serge Hallyn wrote: > > > Quoting Serge Hallyn (serge.hal...@ubuntu.com): > > > > Quoting Chris

Re: [lxc-devel] [PATCH] Add remove_snapshots_entry() (rebased - v2)

2015-09-14 Thread Christian Brauner
On Mon, Sep 14, 2015 at 04:33:05PM +, Serge Hallyn wrote: > Quoting Serge Hallyn (serge.hal...@ubuntu.com): > > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > > On Mon, Sep 14, 2015 at 02:50:39PM +, Serge Hallyn wrote: > > > > Quoting Chris

[lxc-devel] [PATCH] Cleanup parts of lxc-destroy

2015-09-29 Thread Christian Brauner
A bit of pedantry usually doesn't hurt. The code should be easier to follow now and avoids some repetitions. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/lxc_destroy.c | 31 +-- 1 file changed, 17 insertions(+), 14 deletions(-)

[lxc-devel] [PATCH] Make lxc-start-ephemeral use lxc.ephemeral

2015-09-30 Thread Christian Brauner
While lxc-copy is under review let users benefit (reboot survival etc.) from the new lxc.ephemeral option already in lxc-start-ephemeral. This way we can remove the lxc.hook.post-stop script- Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/lxc-start-ephemeral.i

[lxc-devel] [PATCH] Add lxc.ephemeral to lxc.container.conf manpage

2015-09-30 Thread Christian Brauner
Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- doc/lxc.container.conf.sgml.in | 20 1 file changed, 20 insertions(+) diff --git a/doc/lxc.container.conf.sgml.in b/doc/lxc.container.conf.sgml.in index eb3241f..f816491 100644 ---

Re: [lxc-devel] [PATCH] Add lxc-copy executable lxc-copy merges lxc-clone + lxc-start-ephemeral into one

2015-09-28 Thread Christian Brauner
-m union=/src:/dest gets split into -m aufs=/src:/dest and -m overlay=/src:/dest. On Sep 23, 2015 11:20 AM, "Christian Brauner" <christianvanbrau...@gmail.com> wrote: > This is a complete reimplementation of lxc-clone and lxc-start-ephemeral. > > Signed-off-by: Christian

[lxc-devel] [PATCH] Make overlayfs mounts work directly

2015-10-04 Thread Christian Brauner
in accordance with the kernel-documentation. Specifying lxc.mount.entry = /lower merged overlay lowerdir=/lower,create=dir will fail when no upperdir and workdir options are given. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/conf.c

[lxc-devel] [PATCH v2] Make overlayfs mounts work directly

2015-10-04 Thread Christian Brauner
to a read-only overlay mount in accordance with the kernel-documentation. Specifying lxc.mount.entry = /lower merged overlay lowerdir=/lower,create=dir will fail when no upperdir and workdir options are given. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- s

[lxc-devel] [PATCH v3] Make overlayfs mounts work directly

2015-10-04 Thread Christian Brauner
to a read-only overlay mount in accordance with the kernel-documentation. Specifying lxc.mount.entry = /lower merged overlay lowerdir=/lower,create=dir will fail when no upperdir and workdir options are given. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- s

[lxc-devel] lxc.mount.entry for overlayfs

2015-10-02 Thread Christian Brauner
While working on ephemeral container I observed on shortcoming regarding overlay mount entries: Currently users cannot simply specify an entry lxc.mount.entry = /home/chb/files/Bucket opt overlay

[lxc-devel] [PATCH] Free allocated memory on failure (v2)

2015-09-28 Thread Christian Brauner
Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/bdev.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index 21a64f7..846fd82 100644 --- a/src/lxc/bdev.c +++ b/src/lxc/bdev.c @@ -2461,12 +2461,15 @@ stat

[lxc-devel] [PATCH] Check return value of snprintf in mount_proc_if_needed()

2015-09-27 Thread Christian Brauner
Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/utils.c | 4 1 file changed, 4 insertions(+) diff --git a/src/lxc/utils.c b/src/lxc/utils.c index 0b83960..8e7fc52 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1431,6 +1431,10 @@ int mount_proc_if_

[lxc-devel] [PATCH] Free allocated memory on failure

2015-09-27 Thread Christian Brauner
Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/bdev.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index 21a64f7..8a62008 100644 --- a/src/lxc/bdev.c +++ b/src/lxc/bdev.c @@ -2461,12 +2

Re: [lxc-devel] Passed: brauner/lxc#2 (lxccopy_master - a1bdd24)

2015-09-29 Thread Christian Brauner
nds > Commit: a1bdd24 (lxccopy_master) > Author: Christian Brauner > Message: Sensible names for mount keys for switch statement > > Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> > > View the changeset: > https://github.com/brauner/lxc/compare/f9d82

[lxc-devel] [PATCH v2] Cleanup parts of lxc-destroy

2015-09-29 Thread Christian Brauner
A bit of pedantry usually doesn't hurt. The code should be easier to follow now and avoids some repetitions. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/lxc_destroy.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff

Re: [lxc-devel] [PATCH v2] Cleanup parts of lxc-destroy

2015-09-30 Thread Christian Brauner
Sorry, my teachers pounded a violent hatred for gotos for non-cleanup purposes into me. Thanks. :) On Wed, Sep 30, 2015 at 04:13:12PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > A bit of pedantry usually doesn't hurt. The code should

[lxc-devel] [PATCH] Add CAP_AUDIT_READ

2015-09-27 Thread Christian Brauner
CAP_AUDIT_READ (since Linux 3.16) Allow reading the audit log via a multicast netlink socket. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/conf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 1b71795..6

[lxc-devel] [PATCH] Add CAP_BLOCK_SUSPEND

2015-09-27 Thread Christian Brauner
CAP_BLOCK_SUSPEND (since Linux 3.5) Employ features that can block system suspend (epoll(7) EPOLLWAKEUP, /proc/sys/wake_lock). Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/conf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lxc/conf.c b/s

[lxc-devel] [PATCH] New approach to remove container entry from lxc_snapshots

2015-09-09 Thread Christian Brauner
please check if my calculations for memmove() and ftruncate() are correct.) Christian Brauner (1): Ensure that mmap()ed memory is \0-terminated lseek() to end of file and write() terminating \0-byte src/lxc/lxccontainer.c | 88 +++--- 1 file

[lxc-devel] [PATCH] Ensure that mmap()ed memory is \0-terminated (v2) Use pwrite() to write terminating \0-byte

2015-09-09 Thread Christian Brauner
This allows us to use standard string handling functions and we can avoid using the GNU-extension memmem(). This simplifies removing the container from the lxc_snapshots file. Wrap strstr() in a while loop to remove duplicate entries. Signed-off-by: Christian Brauner <christianvanb

[lxc-devel] [PATCH] Ensure that mmap()ed memory is \0-terminated lseek() to end of file and write() terminating \0-byte

2015-09-09 Thread Christian Brauner
This allows us to use standard string handling functions and we can avoid using the GNU-extension memmem(). This simplifies removing the container from the lxc_snapshots file. Wrap strstr() in a while loop to remove duplicate entries. Signed-off-by: Christian Brauner <christianvanb

[lxc-devel] [PATCH] New approach to remove container entry from lxc_snapshots (v2)

2015-09-09 Thread Christian Brauner
check if my calculations for memmove() and ftruncate() are correct.) Christian Brauner (1): Ensure that mmap()ed memory is \0-terminated (v2) Use pwrite() to write terminating \0-byte src/lxc/lxccontainer.c | 85 ++ 1 file changed, 44

Re: [lxc-devel] lxc-start-ephemeral: passing a command

2015-09-18 Thread Christian Brauner
On Fri, Sep 18, 2015 at 06:08:30PM +0200, Christian Brauner wrote: > When using lxc-start-ephemeral with a command that is supposed to be run in > the > container: > > lxc-start-ephemeral -o aa /bin/sh > > What is the expected behaviour: > > 1) S

[lxc-devel] [PATCH] Fix reallocation calculation

2015-09-21 Thread Christian Brauner
Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/lxc_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/lxc_info.c b/src/lxc/lxc_info.c index 9f1c469..58ff619 100644 --- a/src/lxc/lxc_info.c +++ b/src/lxc/lxc_info.c @@ -53,7

[lxc-devel] [PATCH] Fix reallocation calculation

2015-09-21 Thread Christian Brauner
I'm pretty sure this is supposed to be realloc(key, (keys + 1) * sizeof(key[0])); instead of realloc(key, keys+1 * sizeof(key[0])); Christian Brauner (1): Fix reallocation calculation src/lxc/lxc_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.5.3

[lxc-devel] [PATCH] Add lxc-copy executable (v2)

2015-09-24 Thread Christian Brauner
} and are specified e.g. lxc-copy -n aa -e -m bind=/src:/dest:ro,aufs=/src:/dest:rw,overlay=/src:/dest Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/Makefile.am | 2 + src/lxc/arguments.h | 6 +- src/lxc/lxc_copy.c

[lxc-devel] [PATCH] lxc-copy = lxc-clone + lxc-start-ephemeral (v1)

2015-09-23 Thread Christian Brauner
uses (default for both is overlayfs). That is lxc-copy -n aa -e -B aufs -m bind=/src:/dest:ro,bind=/src:/dest:rw,union=/src:/dest implies aufs is used for the union mounts. Christian Brauner (1): Add lxc-copy executable lxc-copy merges lxc-clone + lxc-start-ephemeral

[lxc-devel] [PATCH] Make ephemeral containers survive reboots

2015-09-21 Thread Christian Brauner
Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/start.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index 3dd1064..4e977c5 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -502,7 +502,7 @@ void lx

[lxc-devel] [PATCH] Make ephemeral containers survive reboots

2015-09-21 Thread Christian Brauner
With this patch, ephemeral containers will survive reboots Christian Brauner (1): Make ephemeral containers survive reboots src/lxc/start.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.5.3 ___ lxc-devel mailing list lxc-devel

[lxc-devel] lxc-start-ephemeral: passing a command

2015-09-18 Thread Christian Brauner
When using lxc-start-ephemeral with a command that is supposed to be run in the container: lxc-start-ephemeral -o aa /bin/sh What is the expected behaviour: 1) Start the container with its normal init process and then run the command in the container? 2) Start

[lxc-devel] [PATCH] Add lxc-copy executable lxc-copy merges lxc-clone + lxc-start-ephemeral into one

2015-09-23 Thread Christian Brauner
This is a complete reimplementation of lxc-clone and lxc-start-ephemeral. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/Makefile.am | 2 + src/lxc/arguments.h | 6 +- src/lxc/lxc_copy.c | 723 3

Re: [lxc-devel] [PATCH] seccomp: support 32-bit arm on arm64, and 32-bit ppc on ppc64

2015-12-03 Thread Christian Brauner
On Wed, Dec 02, 2015 at 10:42:36PM +, Serge Hallyn wrote: > Generally we enforce that a [arch] seccomp section can only be used on [arch]. > However, on amd64 we allow [i386] sections for i386 containers, and there we > also take [all] sections and apply them for both 32- and 64-bit. > > Do

[lxc-devel] [PATCH] Conditional compilation for ARM and PPC

2015-12-03 Thread Christian Brauner
Check if symbols SCMP_ARCH_ARM and SCMP_ARCH_PPC are defined. Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- src/lxc/seccomp.c | 4 1 file changed, 4 insertions(+) diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c index c5f1885..5982cb4 100644 --- a/src/lxc/sec

[lxc-devel] [PATCH] Conditional compilation for ARM and PPC

2015-12-03 Thread Christian Brauner
Before commit 29753076fddfed772511c67887bed1f0621b32cf libseccomp does not define the symbol SCMP_ARCH_PPC. Just for safety also add conditional compilation instructions for SCMP_ARCH_ARM. Christian Brauner (1): Conditional compilation for ARM and PPC src/lxc/seccomp.c | 4 1 file

[lxc-devel] [PATCH] Add concise explanations

2015-12-09 Thread Christian Brauner
- explain functions in list.h - let lxc_list_len() return size_t instead of int Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- I'm working on some stuff that employs struct lxc_list. I already previously found that list.h lacked some short documentation s

Re: [lxc-devel] On the road to LXC 2.0.0

2015-12-23 Thread Christian Brauner
On Wed, Dec 23, 2015 at 08:57:36AM -0700, Tycho Andersen wrote: > On Mon, Dec 21, 2015 at 05:12:12PM -0500, Stéphane Graber wrote: > > Hey everyone, > > > > So you may have noticed I just tagged LXC 2.0.0 beta1. > > > > The current plan is as follow: > > - LXC 2.0.0 beta2 next week (28th) > >

[lxc-devel] [PATCH] fix lockpath removal in Python lxc-ls

2016-01-11 Thread Christian Brauner
The lock path for lxc is not RUNTIME_PATH/lock/lxc but rather RUNTIME_PATH/lxc/lock Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- src/lxc/lxc-ls.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/lxc-ls.in b/src/lxc/lxc

[lxc-devel] [PATCH] lxc-ls: try to protect stack in recursive function

2016-01-13 Thread Christian Brauner
a lot of containers your might run into trouble. Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- src/lxc/arguments.h | 2 +- src/lxc/lxc_ls.c| 37 ++--- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/lxc/arguments.h

[lxc-devel] [PATCH] lxc-ls: check for ENOMEM and tweaking

2016-01-15 Thread Christian Brauner
if compilers will always optimize this let's move all variable declarations outside of the loop. They should still be fairly self explanatory. Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- src/lxc/lxc_ls.c | 57

[lxc-devel] [PATCH] lxc-ls: set ls_nesting to 0 initially

2016-01-15 Thread Christian Brauner
Otherwise users will always get nested containers listed. Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- src/lxc/lxc_ls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/lxc_ls.c b/src/lxc/lxc_ls.c index 7d46426..dd73f19 100644 --- a/s

Re: [lxc-devel] [PATCH] lxc-ls: check for ENOMEM and tweaking

2016-01-15 Thread Christian Brauner
On Fri, Jan 15, 2016 at 08:40:19PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christian.brau...@mailbox.org): > > If lxc_container_new() fails we check for ENOMEN and goto out if ENOMEM is > > not > > set we will simply continue. The same goes fo

[lxc-devel] [PATCH v2] lxc-ls: check for ENOMEM and tweaking

2016-01-15 Thread Christian Brauner
don't know if compilers will always optimize this let's move *some* variable declarations outside of the loop when it does not hinder readability Set ls_nesting to 0 initially. Otherwise users will always see nested containers printed. Signed-off-by: Christian Brauner <christian.brau...@mailbox.

Re: [lxc-devel] [PATCH] lxc-ls: check for ENOMEM and tweaking

2016-01-15 Thread Christian Brauner
Ignore. On Sat, Jan 16, 2016 at 12:57:24AM +0100, Christian Brauner wrote: > If lxc_container_new() fails we check for ENOMEM and if so goto out. If ENOMEM > is not set we will simply continue. The same goes for the call to regcomp() > but > instead of checking for ENOMEM we n

[lxc-devel] [PATCH] lxc-ls: check for ENOMEM and tweaking

2016-01-15 Thread Christian Brauner
don't know if compilers will always optimize this let's move *some* variable declarations outside of the loop when it does not hinder readability Set ls_nesting to 0 initially. Otherwise users will always see nested containers printed. Signed-off-by: Christian Brauner <christian.brau...@mailbox.

Re: [lxc-devel] [PATCH v2] lxc-ls: check for ENOMEM and tweaking

2016-01-15 Thread Christian Brauner
On Sat, Jan 16, 2016 at 12:50:01AM +, Serge Hallyn wrote: > Quoting Christian Brauner (christian.brau...@mailbox.org): > > If lxc_container_new() fails we check for ENOMEM and if so goto out. If > > ENOMEM > > is not set we will simply continue. The same goes fo

[lxc-devel] [PATCH] add lxc-copy to see_also.sgml.in

2016-01-14 Thread Christian Brauner
Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- doc/see_also.sgml.in | 5 + 1 file changed, 5 insertions(+) diff --git a/doc/see_also.sgml.in b/doc/see_also.sgml.in index 4954e8e..3b3ecd7 100644 --- a/doc/see_also.sgml.in +++ b/doc/see_also.sgml.in @@ -38,6

[lxc-devel] [PATCH] Adapt manpage for lxc-ls to new C implementation

2016-01-18 Thread Christian Brauner
- explain new -r,--regex flag - explain new numeric argument to --nesting - include common options as lxc-ls now uses the standard lxc parser - add history section and update authors Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- doc/lxc-ls.sgml.i

[lxc-devel] [PATCH] check for btrfs fs in should_default_to_snapshot

2016-01-14 Thread Christian Brauner
Check if we're really on a btrfs filesystem before we call btrfs_same_fs(). Otherwise we will report misleading errors although everything went fine. Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- src/lxc/bdev/lxcbtrfs.c | 2 +- src/lxc/bdev/lxcoverlay.c | 2 +- s

Re: [lxc-devel] cgroup V2 and LXC

2016-02-10 Thread Christian Brauner
On Wed, Feb 10, 2016 at 05:45:48PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christian.brau...@mailbox.org): > > On Mon, Feb 01, 2016 at 04:56:08AM +, Serge Hallyn wrote: > > > Quoting Kevin Wilson (wkev...@gmail.com): > > > > Hi, LXC developer

Re: [lxc-devel] cgroup V2 and LXC

2016-02-09 Thread Christian Brauner
On Mon, Feb 01, 2016 at 04:56:08AM +, Serge Hallyn wrote: > Quoting Kevin Wilson (wkev...@gmail.com): > > Hi, LXC developers, > > > > The latest kernel release (4.4) includes initial support to cgroup v2 > > with 2 controllers (memory and io). Also it seems that the PIDs > > controller works

[lxc-devel] [PATCH] Remove wrong command line arg from help output

2016-01-28 Thread Christian Brauner
Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- Slipped my attention before unfortunately. --- src/lxc/lxc_ls.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lxc/lxc_ls.c b/src/lxc/lxc_ls.c index b7034dc..aae2512 100644 --- a/s

[lxc-devel] [PATCH 3/3] lxc-ls: tweak algorithm for ls_has_all_grps()

2016-01-28 Thread Christian Brauner
100 groups and regularly use lxc-ls with -g/--groups to only show containers that have 50 specified groups among their 50-100 groups we can revisit this issue and implement e.g. binary search or a ternary search tree. Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> ---

[lxc-devel] [PATCH 2/3] Restore old behaviour [filter] behaviour

2016-01-28 Thread Christian Brauner
passing the regex. Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- src/lxc/arguments.h | 2 +- src/lxc/lxc_ls.c| 37 - 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/lxc/arguments.h b/src/lxc/arguments.h

[lxc-devel] [PATCH 1/3] lxc-ls: check for ENOMEM and tweaking

2016-01-28 Thread Christian Brauner
ls_get() and not in main() while at the same time giving us an easy way to share lockpath amongst all non-fork()ing recursive calls to ls_get(). Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- src/lxc/lxc_ls.c | 106 +-

[lxc-devel] [PATCH 0/3 - Previously Acked-by Serge (cc-ing him nonetheless]

2016-01-28 Thread Christian Brauner
Christian Brauner (3): lxc-ls: check for ENOMEM and tweaking Restore old behaviour [filter] behaviour lxc-ls: tweak algorithm for ls_has_all_grps() src/lxc/arguments.h | 5 +- src/lxc/lxc_ls.c| 180 +--- 2 files changed, 115 insertions

Re: [lxc-devel] PID of a process inside an lxc container

2016-02-03 Thread Christian Brauner
On Wed, Feb 03, 2016 at 04:49:04PM +0200, Kevin Wilson wrote: > Hi, > > When I create an lxc container and run a simple process (which all it > does is call pause()), > I see the pid of this process also in the host (Simply by running ps > aux | grep pause). > And of course I see it also inside

[lxc-devel] [PATCH] lxc-copy: cleanup

2016-01-28 Thread Christian Brauner
Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- src/lxc/lxc_copy.c | 44 ++-- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/src/lxc/lxc_copy.c b/src/lxc/lxc_copy.c index 9812176..5919bf6 100644 --- a/src/lxc/lxc_

Re: [lxc-devel] cgroup V2 and LXC

2016-02-23 Thread Christian Brauner
On Mon, Feb 15, 2016 at 07:48:05PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christian.brau...@mailbox.org): > > On Wed, Feb 10, 2016 at 05:45:48PM +, Serge Hallyn wrote: > > > Quoting Christian Brauner (christian.brau...@mailbox.org): > > > > On M

Re: [lxc-devel] [PATCH] lxc-ls: remove unused argument + small fixes

2016-01-19 Thread Christian Brauner
On Tue, Jan 19, 2016 at 09:02:00PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > - remove unused argument from ls_get() > > - Fix ls_has_all_groups() but leave the inefficient basic algorithm > > untouched > > for now. (W

Re: [lxc-devel] [PATCH] Adapt manpage for lxc-ls to new C implementation

2016-01-19 Thread Christian Brauner
On Tue, Jan 19, 2016 at 05:26:59PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > - explain new -r,--regex flag > > - explain new numeric argument to --nesting > > - include common options as lxc-ls now uses the standard lxc par

[lxc-devel] [PATCH] Adapt manpage for lxc-ls to new C implementation

2016-01-19 Thread Christian Brauner
- explain new numeric argument to --nesting - include common options as lxc-ls now uses the standard lxc parser - add history section and update authors Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- Changelog: 2016-01-20T0206: - Leave ex

[lxc-devel] [PATCH] lxc.rootfs: support multiple lower layers

2016-01-19 Thread Christian Brauner
Do it in a safe way by using strstr() to check for the substring ":/" should ':' be part of a pathname. This should be a safer implementation than the one originally suggested in #547. Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- src/lxc/bdev/l

[lxc-devel] [PATCH] update overlayfs and aufs in lxc.container.conf

2016-01-23 Thread Christian Brauner
Explain that multiple /lower layers can be used. Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- doc/lxc.container.conf.sgml.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/lxc.container.conf.sgml.in b/doc/lxc.container.conf.sgml.in

<    1   2   3   4   5   6   >