[lxc-devel] [PATCH] /proc/stat in lxcfs

2015-02-16 Thread Christian Brauner
; Your way is the better way to do it. I adjusted and squased the PR and post the patch again here as well: commit 21c3c7ace34eaf5f19074e33d050896b5cc3 Author: Christian Brauner christianvanbrau...@gmail.com Date: Sun Feb 15 11:31:31 2015 +0100 Show cpu-average in /proc/stat and start cup

[lxc-devel] Systemd creates btrfs subvolume under /var/lib/machines and makes lxc-destroy fail

2015-02-17 Thread Christian Brauner
Quoting Christian Brauner (christianvanbrauner at gmail.com): On Sun, Feb 15, 2015 at 05:21:19PM +0100, Christian Brauner wrote: Hello, I test the newest systemd from git on a regular basis by compiling it and installing it into a container and booting it. I did

[lxc-devel] Followup to: capset fails with userns

2015-02-11 Thread Christian Brauner
Here is the original problem which I'm still experiencing with lxc 1.1: w/ userns: [root at fedora2 ~]# setcap 'cap_net_admin,cap_net_raw+ep' /usr/bin/ping Failed to set capabilities on file `/usr/bin/ping' (Operation not permitted) [root at fedora2 ~]# id uid=0(root) gid=0(root)

[lxc-devel] Systemd creates btrfs subvolume under /var/lib/machines and makes lxc-destroy fail

2015-02-15 Thread Christian Brauner
Hello, I test the newest systemd from git on a regular basis by compiling it and installing it into a container and booting it. I did that with the several current systemd versions from git for the last couple of weeks. It seems that in the next version when booting a container with lxc-start,

[lxc-devel] [PATCH] /proc/stat in lxcfs

2015-02-15 Thread Christian Brauner
for that: Signed-off-by: Christian Brauner christianvanbrau...@gmail.com Date: Sun Feb 15 10:34:41 2015 +0100 Bring the cpu-average line to /proc/stat mounted by lxcfs and let the core numbering start at 0. diff --git a/lxcfs.c b/lxcfs.c index d6fb101..ab296e7 100644 --- a/lxcfs.c +++ b/lxcfs.c

[lxc-devel] uidmapshift et al.

2015-02-21 Thread Christian Brauner
Hello, I think it would be a really good idea to provide the nsexec tools with lxc per default. A lot of users (including myself) probably bootstrap a new filesystem for various distributions. Hence, they do not necessarily rely on templates or download templates provided with lxc. In order to

[lxc-devel] Archlinux in download

2015-05-29 Thread Christian Brauner
Hello, since systemd 219 was released and included in Archlinux unprivileged Archlinux containers work out of the box. Simply bootstrapping a barebone rootfs via pacstrap and uidmapshifting it will suffice. However, it would be convenient to be able to download unprivileged Archlinux containers

Re: [lxc-devel] [PATCH 4/4] Fix grammar in some of the executables NAME for name of the container becomes NAME of the container

2015-08-20 Thread Christian Brauner
Updated PR on Github. Retains old behaviour of lxc executables. ___ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel

[lxc-devel] Extending lxc_arguments struct

2015-08-04 Thread Christian Brauner
Hi Serge, hi Stéphane, currently the struct lxc_arguments lacks quite a few options which are required by e.g. lxc-snapshot and lxc-clone which leads to a non-uniform implementation of some of the executables. Would you be open to adding new members to the lxc_arguments struct in order to rewrite

Re: [lxc-devel] [PATCH] Refactor lxc-snapshot

2015-08-07 Thread Christian Brauner
Updated version as PR on github. On Thu, Aug 06, 2015 at 03:47:04PM +0200, Christian Brauner wrote: - lxc_snapshot.c lacked necessary members in the associated lxc_arguments struct in arguments.h. This commit extends the lxc_arguments struct to include several parameters used by lxc

[lxc-devel] [PATCH 2/4] lxc-destroy: Remove container with all snapshots

2015-08-14 Thread Christian Brauner
. Signed-off-by: Christian Brauner christianvanbrau...@gmail.com --- src/lxc/lxc_destroy.c | 74 ++- 1 file changed, 56 insertions(+), 18 deletions(-) diff --git a/src/lxc/lxc_destroy.c b/src/lxc/lxc_destroy.c index 955fc23..32bd2b4 100644 --- a/src

[lxc-devel] [PATCH 4/4] Fix grammar in some of the executables NAME for name of the container becomes NAME of the container

2015-08-14 Thread Christian Brauner
Signed-off-by: Christian Brauner christianvanbrau...@gmail.com --- src/lxc/lxc_attach.c | 2 +- src/lxc/lxc_cgroup.c | 2 +- src/lxc/lxc_checkpoint.c | 2 +- src/lxc/lxc_console.c| 2 +- src/lxc/lxc_create.c | 4 ++-- src/lxc/lxc_device.c | 2 +- src/lxc/lxc_execute.c| 2

[lxc-devel] lxc-clone rewrite

2015-08-14 Thread Christian Brauner
Integrating lxc-clone with the standard lxc parser is not possible unless it is allowed to change command line options. lxc-clone uses -n, -P and -o in a way that is inconsistent with the standard lxc common options defined in LXC_COMMON_OPTIONS in arguments.h and the parser in arguments.c. Since

[lxc-devel] [PATCH] mod_rdep(): Write path and name of clone to file

2015-08-13 Thread Christian Brauner
to delete the original container if the file is not empty then it is not safe. Signed-off-by: Christian Brauner christianvanbrau...@gmail.com --- src/lxc/lxccontainer.c | 98 +++--- 1 file changed, 61 insertions(+), 37 deletions(-) diff --git a/src

Re: [lxc-devel] [PATCH lxcfs 1/2] lxc mount hook: add missing space before ]

2015-10-21 Thread Christian Brauner
On Wed, Oct 21, 2015 at 01:48:17PM +, Serge Hallyn wrote: > Quoting Wolfgang Bumiller (w.bumil...@proxmox.com): > > Otherwise [ interprets the ] as part of the path and also > > errors about a missing ']' > > Thought this had already been applied, but not seeing it in master, > so I sent the

Re: [lxc-devel] [PATCH v2] Update absolute paths for overlay and aufs mounts

2015-10-23 Thread Christian Brauner
On Thu, Oct 22, 2015 at 02:15:18PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > On Thu, Oct 22, 2015 at 01:13:35PM +, Serge Hallyn wrote: > > > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > > > On T

[lxc-devel] [PATCH v5] Parse rootfs->path

2015-10-22 Thread Christian Brauner
Changes: if ((s3 = strstr(s2, ":/"))) s2[strlen(s2) - strlen(s3)] obviously simplifies to if ((s3 = strstr(s2, ":/"))) *s3 = '\0'; Christian Brauner (1): Parse rootfs->pat

[lxc-devel] [PATCH v5] Parse rootfs->path

2015-10-22 Thread Christian Brauner
kwards for the first occurrence of the delimiter pair ":/". We do not simply search for ":" since it might be used in path names. If ":/" is not found we assume the container is directory backed and simply return strdup(rootfs->path). Signed-off-by: Christian Brauner <

Re: [lxc-devel] [PATCH v4] Parse rootfs->path

2015-10-22 Thread Christian Brauner
On Thu, Oct 22, 2015 at 03:33:30AM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > The mount_entry_overlay_dirs() and mount_entry_aufs_dirs() functions create > > workdirs and upperdirs for overlay and aufs lxc.mount.entry entries

[lxc-devel] [PATCH 1/2] Simplify function

2015-10-25 Thread Christian Brauner
Instead of duplicating the cleanup-code, once for success and once for failure, simply keep a variable fret which is -1 in the beginning and gets set to 0 on success or stays -1 on failure. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/conf.c | 14 ++-

[lxc-devel] [PATCH 2/2] Create random workdir for overlay mounts

2015-10-25 Thread Christian Brauner
When no explicit workdir is given we simply create a random workdir using mkdtemp(). Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/conf.c | 31 --- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/lxc/conf.c b/s

[lxc-devel] [PATCH 0/2] Create random workdir for overlay mounts

2015-10-25 Thread Christian Brauner
(). Christian Brauner (2): Simplify function Create random workdir for overlay mounts src/lxc/conf.c | 45 ++--- 1 file changed, 30 insertions(+), 15 deletions(-) -- 2.6.2 ___ lxc-devel mailing list lxc-devel

[lxc-devel] [PATCH 0/2] Update absolute paths for overlay and aufs mounts

2015-10-27 Thread Christian Brauner
e various temporary variables inside the lxc_list_for_each(iterator, _conf->mount_list) {*/ do stuff */} per Serge's request. (4) Use uniform exit strategy when the function fails or succeeds. Christian Brauner (2): Add clone_update_unexp_ovl_dir() function Update absolute paths for over

Re: [lxc-devel] [PATCH 0/2] Create random workdir for overlay mounts

2015-10-27 Thread Christian Brauner
On Tue, Oct 27, 2015 at 05:26:53PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > - When no explicit workdir is given we simply create a random workdir using > > mkdtemp(). > > - The temporary workdir is not removed whe

Re: [lxc-devel] [PATCH 1/2] Add clone_update_unexp_ovl_dir() function

2015-10-29 Thread Christian Brauner
According to my testing I'm making a miscalulation here somewhere... On Tue, Oct 27, 2015 at 09:32:49PM +0100, Christian Brauner wrote: > Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> > --- > src/lxc

Re: [lxc-devel] [PATCH v4] Parse rootfs->path

2015-10-22 Thread Christian Brauner
On Thu, Oct 22, 2015 at 02:59:28AM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > On Tue, Oct 20, 2015 at 09:21:48PM +0200, Christian Brauner wrote: > > > The mount_entry_overlay_dirs() and mount_entry_aufs_dirs() functions > >

Re: [lxc-devel] odd freezer cgroup behavior

2015-10-28 Thread Christian Brauner
On Wed, Oct 28, 2015 at 04:08:09PM +0900, Tycho Andersen wrote: > Hi all, > > I'm seeing some (what seems to me to be) odd behavior, where only a > task's init process is in its freezer cgroup: > > firedrill:~ sudo lxc-info -n proposed > Name: proposed > State: RUNNING > PID:

[lxc-devel] [PATCH] Improve coding style and coding conventions

2015-11-10 Thread Christian Brauner
Local variables should not have the same name as global variables to avoid confusion. Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- src/lxc/lxc_copy.c | 81 +++--- 1 file changed, 41 insertions(+), 40 deletions(-) diff

Re: [lxc-devel] [PATCH v3] Add lxc-copy executable

2015-11-09 Thread Christian Brauner
On Mon, Nov 09, 2015 at 07:55:31PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > This is a complete reimplementation of lxc-clone and lxc-start-ephemeral. > > lxc-copy merges the functionalities of lxc-clone + lxc-start-ephemeral. >

[lxc-devel] [PATCH 2/3] Fix mode when creating temporary directory

2015-11-09 Thread Christian Brauner
From: Christian Brauner <christianvanbrau...@gmail.com> When we create a random container directory with mkdtemp() we set the mode to 0770 otherwise do_lxcapi_clone() will complain about not being able to create the config. Signed-off-by: Christian Brauner <christianvanbrau...@

[lxc-devel] [PATCH v2] Do not pass global variable as pointer

2015-11-09 Thread Christian Brauner
Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- src/lxc/lxc_copy.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/lxc/lxc_copy.c b/src/lxc/lxc_copy.c index e5f52d2..be2e3ee 100644 --- a/src/lxc/lxc_copy.c +++ b/src/lxc/lxc_

[lxc-devel] [PATCH] Add manpage for lxc-copy

2015-11-12 Thread Christian Brauner
(A trivial fix for lxc-copy is included.) Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- configure.ac | 1 + doc/Makefile.am | 1 + doc/lxc-copy.sgml.in | 291 +++ src/lxc/lxc_copy.c | 2 +- 4

[lxc-devel] [PATCH] Add manpage for lxc-copy

2015-11-12 Thread Christian Brauner
(A trivial fix for lxc-copy is included.) Signed-off-by: Christian Brauner <christian.brau...@mailbox.org> --- configure.ac | 1 + doc/Makefile.am | 1 + doc/lxc-copy.sgml.in | 291 +++ src/lxc/lxc_copy.c | 2 +- 4

Re: [lxc-devel] [PATCH 2/2 v3] Update absolute paths for overlay and aufs mounts

2015-11-02 Thread Christian Brauner
On Mon, Nov 02, 2015 at 03:12:02PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > When using overlay and aufs mounts with lxc.mount.entry users have to > > specify > > absolute paths for upperdir and workdir which

Re: [lxc-devel] [PATCH 1/2 v3] Add clone_update_unexp_ovl_paths() function

2015-11-02 Thread Christian Brauner
On Mon, Nov 02, 2015 at 02:38:16PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > This functions updates absolute paths for overlay upper- and workdirs so > > users > > can simply clone and start new containers without wo

Re: [lxc-devel] [PATCH 1/2 v3] Add clone_update_unexp_ovl_paths() function

2015-11-02 Thread Christian Brauner
On Mon, Nov 02, 2015 at 02:38:16PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > This functions updates absolute paths for overlay upper- and workdirs so > > users > > can simply clone and start new containers without wo

Re: [lxc-devel] [PATCH 1/2 v3] Add clone_update_unexp_ovl_paths() function

2015-11-02 Thread Christian Brauner
On Nov 2, 2015 6:43 PM, "Serge Hallyn" <serge.hal...@ubuntu.com> wrote: > > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > On Mon, Nov 02, 2015 at 03:52:25PM +0100, Christian Brauner wrote: > > > On Mon, Nov 02, 2015 at 02:38:16PM +

[lxc-devel] [PATCH 1/2 v2] Add clone_update_unexp_ovl_dir() function

2015-10-30 Thread Christian Brauner
This functions updates absolute paths for overlay upper- and workdirs so users can simply clone and start new containers without worrying about absolute paths in lxc.mount.entry overlay entries. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/confile.c

[lxc-devel] [PATCH 2/2 v2] Update absolute paths for overlay and aufs mounts

2015-10-30 Thread Christian Brauner
y_dirs() and mount_entry_create_aufs_dirs() will still refuse to create upperdir and workdir when the updated path is unclean. This happens easily when e.g. a user calls lxc-clone -o OLD -n NEW -P //home//chb///. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/lxccont

[lxc-devel] [PATCH 0/2 v3] Update absolute paths for overlay and aufs mounts

2015-11-01 Thread Christian Brauner
_config by using a separate function clone_update_unexp_ovl_dir() in confile.c. (3) Move various temporary variables inside the lxc_list_for_each(iterator, _conf->mount_list) {*/ do stuff */} per Serge's request. (4) Use uniform exit strategy when the function fails or succeeds.

[lxc-devel] [PATCH 1/2 v3] Add clone_update_unexp_ovl_paths() function

2015-11-01 Thread Christian Brauner
This functions updates absolute paths for overlay upper- and workdirs so users can simply clone and start new containers without worrying about absolute paths in lxc.mount.entry overlay entries. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/confile.c

Re: [lxc-devel] [PATCH 1/2 v2] Add clone_update_unexp_ovl_dir() function

2015-10-30 Thread Christian Brauner
On Oct 30, 2015 4:08 PM, "Serge Hallyn" <serge.hal...@ubuntu.com> wrote: > > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > This functions updates absolute paths for overlay upper- and workdirs so users > > can simply clone and start new containe

[lxc-devel] Fwd: Re: [PATCH 2/2 v2] Update absolute paths for overlay and aufs mounts

2015-10-30 Thread Christian Brauner
-- Forwarded message -- From: "Christian Brauner" <christianvanbrau...@gmail.com> Date: Oct 30, 2015 4:27 PM Subject: Re: [PATCH 2/2 v2] Update absolute paths for overlay and aufs mounts To: "Serge E. Hallyn" <serge.hal...@ubuntu.

[lxc-devel] [PATCH v2] Fix calculations in clone_update_unexp_hooks()

2015-11-03 Thread Christian Brauner
ity. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/confile.c | 60 +++ 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/src/lxc/confile.c b/src/lxc/confile.c index d584964..0565973 100644 --- a/src/lxc/c

[lxc-devel] [PATCH v3] Fix calculations in clone_update_unexp_hooks()

2015-11-03 Thread Christian Brauner
gt;= lend) continue; This should deal better with invalid config files. (3) Insert some spaces between operators to increase readability. (4) Use gotos to simplify function and increase readability. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc

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

2015-11-04 Thread Christian Brauner
Serge, I wonder how many bugs you will find. :) Christian Brauner (1): Add lxc-copy executable src/lxc/Makefile.am | 2 + src/lxc/arguments.h | 2 + src/lxc/lxc_copy.c | 744 3 files changed, 748 insertions(+) create mode 10

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

2015-11-04 Thread Christian Brauner
use mkdtemp() to not just create the names but also directly create the corresponding directories. This will give us more safety and make the code considerably shorter. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/Makefile.am | 2 + src/lxc/arguments.h

[lxc-devel] [PATCH v1] Add lxc-copy executable

2015-11-04 Thread Christian Brauner
use mkdtemp() to not just create the names but also directly create the corresponding directories. This will give us more safety and make the code considerably shorter. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/Makefile.am | 2 + src/lxc/arguments.h

[lxc-devel] [PATCH v1] Add lxc-copy executable

2015-11-04 Thread Christian Brauner
. :) Christian Brauner (1): Add lxc-copy executable src/lxc/Makefile.am | 2 + src/lxc/arguments.h | 2 + src/lxc/lxc_copy.c | 744 3 files changed, 748 insertions(+) create mode 100644 src/lxc/lxc_copy.c -- 2.6.2

Re: [lxc-devel] [PATCH 1/2 v3] Add clone_update_unexp_ovl_paths() function

2015-11-02 Thread Christian Brauner
On Mon, Nov 02, 2015 at 03:52:25PM +0100, Christian Brauner wrote: > On Mon, Nov 02, 2015 at 02:38:16PM +, Serge Hallyn wrote: > > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > > This functions updates absolute paths for overlay upper- and workdirs so >

Re: [lxc-devel] [PATCH 1/2 v3] Add clone_update_unexp_ovl_paths() function

2015-11-02 Thread Christian Brauner
On Mon, Nov 02, 2015 at 02:38:16PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > This functions updates absolute paths for overlay upper- and workdirs so > > users > > can simply clone and start new containers without wo

[lxc-devel] [PATCH 2/2 v4] Update absolute paths for overlay and aufs mounts

2015-11-02 Thread Christian Brauner
still refuse to create upperdir and workdir when the updated path is unclean. This happens easily when e.g. a user calls lxc-clone -o OLD -n NEW -P //home//chb///. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/lxcconta

[lxc-devel] [PATCH 0/2 v4] Update absolute paths for overlay and aufs mounts

2015-11-02 Thread Christian Brauner
. (3) Move various temporary variables inside the lxc_list_for_each(iterator, _conf->mount_list) {*/ do stuff */} per Serge's request. (4) Use uniform exit strategy when the function fails or succeeds. Christian Brauner (3): Add clone_update_unexp_ovl_paths() function Upda

[lxc-devel] [PATCH] Fix wrong calculations in clone_update_unexp_hooks()

2015-11-02 Thread Christian Brauner
hen using lxc-clone. (2) Also we use the stricter check: if (p >= lend) continue; This should deal better with invalid config files. (3) Insert some spaces between operators to increase readability. Signed-off-by: Christian Brauner <christianvanbrau...@gmai

[lxc-devel] [PATCH v3] Add lxc-copy executable

2015-11-06 Thread Christian Brauner
the code considerably shorter. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/Makefile.am | 2 + src/lxc/arguments.h | 2 + src/lxc/lxc_copy.c | 744 3 files changed, 748 insertions(+) create mode 1006

[lxc-devel] [PATCH v3] Add lxc-copy executable

2015-11-06 Thread Christian Brauner
brauner/lxc/tree/lxccopy Serge, I wonder how many bugs you will find. :) Christian Brauner (1): Add lxc-copy executable src/lxc/Makefile.am | 2 + src/lxc/arguments.h | 2 + src/lxc/lxc_copy.c | 744 3 files changed, 748 inserti

Re: [lxc-devel] [PATCH] Fix wrong calculations in clone_update_unexp_hooks()

2015-11-03 Thread Christian Brauner
On Mon, Nov 02, 2015 at 02:36:13PM +0100, Christian Brauner wrote: > (1) This commit fixes some long standing miscalculation when updating paths in > lxc.hooks.* entries. We now also update conf->unexpandend_alloced which > hasn't been done prior to this commit. According t

Re: [lxc-devel] [PATCH] Make mount_entry_create_*_dirs() more robust

2015-10-16 Thread Christian Brauner
On Oct 16, 2015 19:11, "Serge Hallyn" <serge.hal...@ubuntu.com> wrote: > > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > On Fri, Oct 16, 2015 at 03:52:04PM +, Serge Hallyn wrote: > > > Quoting Christian Brauner (christianvanbrau...@gma

Re: [lxc-devel] [PATCH] Make mount_entry_create_*_dirs() more robust

2015-10-16 Thread Christian Brauner
On Fri, Oct 16, 2015 at 05:11:02PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > On Fri, Oct 16, 2015 at 03:52:04PM +, Serge Hallyn wrote: > > > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > > > On T

Re: [lxc-devel] [PATCH] Parse rootfs->path

2015-10-19 Thread Christian Brauner
On Mon, Oct 19, 2015 at 02:50:11PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > The mount_entry_overlay_dirs() and mount_entry_aufs_dirs() functions create > > workdirs and upperdirs for overlay and aufs lxc.mount.entry entries

[lxc-devel] [PATCH] Trivial: fix missing space before closing bracket

2015-10-15 Thread Christian Brauner
Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- share/lxc.mount.hook.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/lxc.mount.hook.in b/share/lxc.mount.hook.in index 7194ab8..5ed2d60 100755 --- a/share/lxc.mount.hook.in +++ b

[lxc-devel] [PATCH v2] Parse rootfs->path

2015-10-19 Thread Christian Brauner
kwards for the first occurrence of the delimiter pair ":/". We do not simply search for ":" since it might be used in path names. If ":/" is not found we assume the container is directory backed and simply return strdup(rootfs->path). Signed-off-by: Christian Brauner <

[lxc-devel] [PATCH v3] Parse rootfs->path

2015-10-20 Thread Christian Brauner
kwards for the first occurrence of the delimiter pair ":/". We do not simply search for ":" since it might be used in path names. If ":/" is not found we assume the container is directory backed and simply return strdup(rootfs->path). Signed-off-by: Christian Brauner <

[lxc-devel] [PATCH v3] Parse rootfs->path

2015-10-20 Thread Christian Brauner
- add NULL-pointer check - initialize rootfslen Christian Brauner (1): Parse rootfs->path src/lxc/conf.c | 115 - 1 file changed, 90 insertions(+), 25 deletions(-) -- 2.6.1 ___ lxc-de

[lxc-devel] [PATCH v4] Parse rootfs->path

2015-10-20 Thread Christian Brauner
kwards for the first occurrence of the delimiter pair ":/". We do not simply search for ":" since it might be used in path names. If ":/" is not found we assume the container is directory backed and simply return strdup(rootfs->path). Signed-off-by: Christian Brauner <

[lxc-devel] [PATCH v4] Parse rootfs->path

2015-10-20 Thread Christian Brauner
A fresh set of eyes would be nice. :) New solution: Use strstr() to search for ":/". If we find ":/" move the string to "/". Check for a second ":/". If we find it replace ':' with '\0'. If we do not find ":/" return strdup(rootfs->path).

Re: [lxc-devel] [PATCH v3] Parse rootfs->path

2015-10-20 Thread Christian Brauner
On Tue, Oct 20, 2015 at 04:31:19PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > On Tue, Oct 20, 2015 at 03:30:19PM +, Serge Hallyn wrote: > > > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > > >

Re: [lxc-devel] [PATCH v3] Parse rootfs->path

2015-10-20 Thread Christian Brauner
On Tue, Oct 20, 2015 at 03:30:19PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > The mount_entry_overlay_dirs() and mount_entry_aufs_dirs() functions create > > workdirs and upperdirs for overlay and aufs lxc.mount.entry entries

Re: [lxc-devel] [PATCH v2] Update absolute paths for overlay and aufs mounts

2015-10-20 Thread Christian Brauner
On Tue, Oct 20, 2015 at 04:17:18PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > When using overlay and aufs mounts with lxc.mount.entry users have to > > specify > > absolute paths for upperdir and workdir which

Re: [lxc-devel] [PATCH v4] Parse rootfs->path

2015-10-20 Thread Christian Brauner
On Tue, Oct 20, 2015 at 09:21:48PM +0200, Christian Brauner wrote: > The mount_entry_overlay_dirs() and mount_entry_aufs_dirs() functions create > workdirs and upperdirs for overlay and aufs lxc.mount.entry entries. They try > to make sure that the workdirs and upperdirs can only be crea

Re: [lxc-devel] [PATCH] Make mount_entry_create_*_dirs() more robust

2015-10-16 Thread Christian Brauner
On Fri, Oct 16, 2015 at 03:52:04PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > On Thu, Oct 15, 2015 at 08:32:25PM +, Serge Hallyn wrote: > > > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > > >

[lxc-devel] [PATCH v2] Update absolute paths for overlay and aufs mounts

2015-10-11 Thread Christian Brauner
kdir when the updated path is unclean. This happens easily when e.g. a user calls lxc-clone -o OLD -n NEW -P //home//chb///. Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> --- src/lxc/lxccontainer.c | 133 - 1 file changed,

Re: [lxc-devel] systemd-226 and lxcfs

2015-10-12 Thread Christian Brauner
Thanks for taking the time to investigate this. I noticed this as well (https://github.com/lxc/lxc/issues/663). The new init.scope slice has been introduced in systemd 226 in order to deal with unified cgroups which have been introduced into the Kernel in version 4.2.1 or 4.2.2. The details why

[lxc-devel] [PATCH] Make mount_entry_create_*_dirs() more robust

2015-10-07 Thread Christian Brauner
to work. Hence, let's not make that assumption. We now pass lxc_path and lxc_name to mount_entry_create_*_dirs() and create the path directly. To prevent failure we also have mount_entry_create_*_dirs() check that lxc_name and lxc_path are not empty when they are passed in. Signed-off-by: Chris

Re: [lxc-devel] [PATCH v5] Make overlayfs mounts work directly

2015-10-07 Thread Christian Brauner
to being under the mounted rootfs dir). > > These paths would be relative to the containerdir. I think that's too > confusing. > > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > I now wonder if it wouldn't be smarter to force users to specify relative >

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

2015-10-06 Thread Christian Brauner
,create=dir will lead 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 <christianvanb

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

2015-10-06 Thread Christian Brauner
No changes apart from the ones Serge requested. Adding Acked-by: Serge E. Hallyn <serge.hal...@ubuntu.com> with Serge's permission. (see hist comments to [PATCH v4]) Christian Brauner (1): Make overlayfs mounts work directly src/lxc/conf.c

Re: [lxc-devel] [PATCH v5] Make overlayfs mounts work directly

2015-10-06 Thread Christian Brauner
work out of the box when a clone of the container is made and started... Thoughts? On Tue, Oct 06, 2015 at 08:38:13PM +0200, Christian Brauner wrote: > When users wanted to mount overlay directories with lxc.mount.entry they had > to > create upperdirs and workdirs beforehand in order

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

2015-10-06 Thread Christian Brauner
Updated version (v4) to follow. On Mon, Oct 05, 2015 at 01:45:53PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > When users wanted to mount overlay directories with lxc.mount.entry they > > had to > > create upperdirs and workdir

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

2015-10-06 Thread Christian Brauner
I now included a check whether rootfs->path is empty in mount_entry_create_overlay_dirs() mount_entry_create_aufs_dirs(). Christian Brauner (1): Make overlayfs mounts work directly src/lxc/conf.c | 156 - 1 file changed, 144 inserti

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

2015-10-06 Thread Christian Brauner
,create=dir will lead 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 <christianvanb

Re: [lxc-devel] [PATCH v5] Make overlayfs mounts work directly

2015-10-09 Thread Christian Brauner
o also restore > those at snapshot restore. > > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > Fair enough. Should we then adapt do_lxcapi_clone() to replace any mountentries > > that involve references to the original container with the name of the new > > cont

Re: [lxc-devel] [PATCH v5] Make overlayfs mounts work directly

2015-10-08 Thread Christian Brauner
I already have a patch for do_lxcapi_clone() ready. I'll sent it later tonight or tomorrow. On Oct 8, 2015 4:59 PM, "Serge Hallyn" <serge.hal...@ubuntu.com> wrote: > > Yes, I think so. Worse, I think that'll mean we'll have to also restore > those at snapshot resto

Re: [lxc-devel] [PATCH] mod_rdep(): Write path and name of clone to file

2015-08-27 Thread Christian Brauner
On Thu, Aug 27, 2015 at 04:17:28PM +, Serge Hallyn wrote: Quoting Christian Brauner (christianvanbrau...@gmail.com): This is rather a first-pass suggestion than a full commit to discuss: The idea: - - If a container has clone-snapshots created by lxc-clone

[lxc-devel] [PATCH] mod_rdep(): Write path and name of clone to file

2015-08-27 Thread Christian Brauner
the corresponding line in the file lxc_snapshot of the original container will be deleted and the file updated via mmap() + memmove() + munmap(). - Adapt has_fs_snapshots(). - **If an lxc-snapshot file in the old format is found we'll keep using it.** Signed-off-by: Christian Brauner christianvanbrau

Re: [lxc-devel] [PATCH] mod_rdep(): Write path and name of clone to file

2015-08-27 Thread Christian Brauner
This is the new version of my modifications to mod_rdep(). It's part of a series of commits present as a PR on Github which also includes the changes necessary to adapt lxc-destroy: https://github.com/lxc/lxc/pull/641 Christian Brauner (1): mod_rdep(): Write path and name of clone to file src

Re: [lxc-devel] lxc-clone rewrite

2015-08-27 Thread Christian Brauner
On Thu, Aug 27, 2015 at 03:41:03PM -0400, Stéphane Graber wrote: On Sun, Aug 16, 2015 at 04:46:31PM +, Serge Hallyn wrote: Quoting Christian Brauner (christianvanbrau...@gmail.com): Integrating lxc-clone with the standard lxc parser is not possible unless it is allowed to change

Re: [lxc-devel] lxc-clone rewrite

2015-08-31 Thread Christian Brauner
On Fri, Aug 28, 2015 at 12:46:17AM +0200, Christian Brauner wrote: > On Thu, Aug 27, 2015 at 03:41:03PM -0400, Stéphane Graber wrote: > > On Sun, Aug 16, 2015 at 04:46:31PM +, Serge Hallyn wrote: > > > Quoting Christian Brauner (christianvanbrau...@gmail.com): > >

Re: [lxc-devel] lxc-clone rewrite

2015-08-31 Thread Christian Brauner
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: > > > Quoting Christian Brauner (christianvanbrauner at gmail.com): > > > > On Fri, Au

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

2015-09-07 Thread Christian Brauner
On Tue, Sep 08, 2015 at 02:36:20AM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com> > > Thanks, this looks good, but I'd like to give it another > look w

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

2015-09-07 Thread Christian Brauner
On Mon, Sep 07, 2015 at 05:10:27PM +, 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/lxccontainer.c b

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-07 Thread Christian Brauner
On Mon, Sep 07, 2015 at 05:25:03PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > Now we can e.g. implement ephemeral containers in a consistent way. > > > > Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com&g

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

2015-09-07 Thread Christian Brauner
On Mon, Sep 07, 2015 at 05:10:27PM +, 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/lxccontainer.c b

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-07 Thread Christian Brauner
On Mon, Sep 07, 2015 at 05:13:56PM +, Serge Hallyn wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > Fixes for the return value checks. > > > > On Sun, Sep 06, 2015 at 10:38:21AM +0200, Christian Brauner wrote: > > > Now we can e.g.

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

2015-09-08 Thread Christian Brauner
Yes, missed this. Updated patch follows after you reviewed the rest. On Sep 8, 2015 9:19 PM, "Serge Hallyn" <serge.hal...@ubuntu.com> wrote: > Quoting Christian Brauner (christianvanbrau...@gmail.com): > > static do_bdev_destroy() and bdev_destroy_wrapper() from lxccontai

[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

[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 | 37 + src/lxc/bdev.

[lxc-devel] Add lxc.ephemeral to destroy container on shutdown (v3)

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 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 | 62 -- 1 file changed, 19 insertions(+), 43 deletions(-) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index fb99892..0eaf98e

  1   2   3   4   5   6   >