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

2015-09-11 Thread Christian Brauner
Use pwrite() to write terminating \0-byte 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:

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

2015-09-11 Thread Christian Brauner
I want to avoid having to use the GNU-extension memmem() when removing the container entry. As mmap() does not guarantee us a \0-terminated string we pwrite() a single terminating \0-byte after the end of the file and the mmap() the file. The terminating \0-byte will then be removed when we

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

2015-09-11 Thread Christian Brauner
When creating ephemeral containers that have the option lxc.ephemeral = 1 set in their config, they will be destroyed on shutdown. As they are simple overlay clones of an existing container they should be registered in the lxc_snapshots file of the original container to stay consistent and adhere

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

2015-09-11 Thread Christian Brauner
When creating ephemeral containers that have the option lxc.ephemeral = 1 set in their config, they will be destroyed on shutdown. As they are simple overlay clones of an existing container they should be registered in the lxc_snapshots file of the original container to stay consistent and adhere

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(). This simplifies removing the

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

2015-09-11 Thread Christian Brauner
When creating ephemeral containers that have the option lxc.ephemeral = 1 set in their config, they will be destroyed on shutdown. As they are simple overlay clones of an existing container they should be registered in the lxc_snapshots file of the original container to stay consistent and adhere

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

2015-09-11 Thread Christian Brauner
When creating ephemeral containers that have the option lxc.ephemeral = 1 set in their config, they will be destroyed on shutdown. As they are simple overlay clones of an existing container they should be registered in the lxc_snapshots file of the original container to stay consistent and adhere

[lxc-devel] [PATCH 3/3] gitignore: add strange lxc@.service file

2015-09-11 Thread Tycho Andersen
I have no idea what this file is, but the build system seems to be generating it, so let's ignore it. Signed-off-by: Tycho Andersen --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9c60c92..5ec52c5 100644 ---

[lxc-devel] [PATCH 1/3] lxc-checkconfig: add some more config options

2015-09-11 Thread Tycho Andersen
Here's some more config options that we do actually require to be able to boot containers. Signed-off-by: Tycho Andersen --- src/lxc/lxc-checkconfig.in | 19 +++ 1 file changed, 19 insertions(+) diff --git a/src/lxc/lxc-checkconfig.in

[lxc-devel] [PATCH 2/3] gitignore: add Korean man page output

2015-09-11 Thread Tycho Andersen
Signed-off-by: Tycho Andersen --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 35d89f2..9c60c92 100644 --- a/.gitignore +++ b/.gitignore @@ -135,6 +135,9 @@ doc/ja/*.5 doc/ja/*.7 doc/ja/legacy/*.1 doc/legacy/*.1

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

2015-09-11 Thread Serge Hallyn
Quoting Christian Brauner (christianvanbrau...@gmail.com): > Use pwrite() to write terminating \0-byte > > 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