Re: [lxc-devel] ubuntu-cloud-prep: patch /sbin/start for overlayfs

2013-08-16 Thread Serge Hallyn
Quoting Scott Moser (smo...@ubuntu.com): > upstart depends on inotify, and overlayfs does not support inotify. > > That means that the following results in 'tgt' not running. tgt is simply > used here as an example of a service that installs an upstart job and > starts it on package install. > lx

[lxc-devel] ubuntu-cloud-prep: patch /sbin/start for overlayfs

2013-08-16 Thread Scott Moser
upstart depends on inotify, and overlayfs does not support inotify. That means that the following results in 'tgt' not running. tgt is simply used here as an example of a service that installs an upstart job and starts it on package install. lxc-clone -s -B overlayfs -o source-precise-amd64 -n te

Re: [lxc-devel] [PATCH] cgroup.c: remove spurious ERROR messages

2013-08-16 Thread Stéphane Graber
On Fri, Aug 16, 2013 at 10:56:58AM -0500, Serge Hallyn wrote: > Signed-off-by: Serge Hallyn Acked-by: Stéphane Graber > --- > src/lxc/cgroup.c | 7 +-- > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c > index 78083e8..135f2c4 100644 > -

Re: [lxc-devel] [PATCH 11/17] Use srand/rand instead of initstate/random

2013-08-16 Thread Daniel P. Berrange
On Fri, Aug 16, 2013 at 06:01:25PM +0200, Stéphane Graber wrote: > On Fri, Aug 16, 2013 at 10:36:58AM -0500, Serge Hallyn wrote: > > Quoting Stéphane Graber (stgra...@ubuntu.com): > > > initstate/random doesn't work on bionic, srand/rand works on everything, > > > so let's use that. > > > > Is ran

Re: [lxc-devel] [PATCH 11/17] Use srand/rand instead of initstate/random

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > On Fri, Aug 16, 2013 at 10:36:58AM -0500, Serge Hallyn wrote: > > Quoting Stéphane Graber (stgra...@ubuntu.com): > > > initstate/random doesn't work on bionic, srand/rand works on everything, > > > so let's use that. > > > > Is rand_r available on b

Re: [lxc-devel] [PATCH 11/17] Use srand/rand instead of initstate/random

2013-08-16 Thread Stéphane Graber
On Fri, Aug 16, 2013 at 10:36:58AM -0500, Serge Hallyn wrote: > Quoting Stéphane Graber (stgra...@ubuntu.com): > > initstate/random doesn't work on bionic, srand/rand works on everything, > > so let's use that. > > Is rand_r available on bionic? > > rand() isn't thread-safe. Unfortunately no, I

[lxc-devel] [PATCH] cgroup.c: remove spurious ERROR messages

2013-08-16 Thread Serge Hallyn
Signed-off-by: Serge Hallyn --- src/lxc/cgroup.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c index 78083e8..135f2c4 100644 --- a/src/lxc/cgroup.c +++ b/src/lxc/cgroup.c @@ -198,11 +198,8 @@ char *lxc_cgroup_path_get(const char *sub

Re: [lxc-devel] [PATCH 05/17] Android now uses a sane clone() definition

2013-08-16 Thread Stéphane Graber
On Fri, Aug 16, 2013 at 10:26:29AM -0500, Serge Hallyn wrote: > Quoting Stéphane Graber (stgra...@ubuntu.com): > > The current Android NDK provides a clone() defintion that's identical to > > Does this mean this will break older androids? Or is that not how it > works? Maybe, I'm not really sure

Re: [lxc-devel] [PATCH 17/17] Fix lxc-user-nic to work on bionic

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > This adds a couple of missing includes, uses the local version of > getline on bionic and replaces getpwuid_r by getpwuid. > > Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn > --- > src/lxc/lxc_user_nic.c | 18 -- > 1

Re: [lxc-devel] [PATCH 16/17] Add missing namespace.h include

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn > --- > src/lxc/lxccontainer.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c > index a64babe..39789fd 100644 > --- a/src/lxc/lxc

Re: [lxc-devel] [PATCH 15/17] Allow building without confstr

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > We use confstr to grab the default PATH value. If it's not there, just > use a standard one with bin and sbin for /, /usr and /usr/local. > > Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn > --- > configure.ac | 2 +- > src/lxc/at

Re: [lxc-devel] [PATCH 14/17] Don't define new_personality when building without personalities

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn > --- > src/lxc/attach.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/lxc/attach.c b/src/lxc/attach.c > index 99b9c89..19fe61d 100644 > --- a/src/lxc/attach.c > +++ b/sr

Re: [lxc-devel] [PATCH 13/17] Add missing sys/socket.h include

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn > --- > src/lxc/attach.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/lxc/attach.c b/src/lxc/attach.c > index 3e9fb5f..99b9c89 100644 > --- a/src/lxc/attach.c > +++ b/src/

Re: [lxc-devel] [PATCH 12/17] Define SOCK_CLOEXEC when missing

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn > --- > src/lxc/attach.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/src/lxc/attach.c b/src/lxc/attach.c > index 950fe9a..3e9fb5f 100644 > --- a/src/lxc/attach.c > +++ b/

Re: [lxc-devel] [PATCH 11/17] Use srand/rand instead of initstate/random

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > initstate/random doesn't work on bionic, srand/rand works on everything, > so let's use that. Is rand_r available on bionic? rand() isn't thread-safe. > Signed-off-by: Stéphane Graber > --- > src/lxc/conf.c | 5 ++--- > 1 file changed, 2 inserti

Re: [lxc-devel] [PATCH 10/17] Include stdio.h in getline.h for FILE

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn > --- > src/include/getline.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/include/getline.h b/src/include/getline.h > index b030d7a..23d6f04 100644 > --- a/src/include/

Re: [lxc-devel] [PATCH 03/17] Export the local getmntent_r implementation

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > New code now uses getmntent_r so we need it exported so that it can be > used when building on bionic. > > Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn > --- > src/include/lxcmntent.h | 1 + > 1 file changed, 1 insertion(+) > > dif

Re: [lxc-devel] [PATCH 08/17] Add missing sys/select.h include for fd_set

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn > --- > src/lxc/lxc.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/lxc/lxc.h b/src/lxc/lxc.h > index b9eb52c..253c440 100644 > --- a/src/lxc/lxc.h > +++ b/src/lxc/lxc.h >

Re: [lxc-devel] [PATCH 09/17] Import local getline copy on bionic

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn > --- > src/lxc/cgroup.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c > index b2b1aa3..221c018 100644 > --- a/src/lxc/cgroup.c > +++

Re: [lxc-devel] [PATCH 07/17] Add missing syscall.h include to utils.h

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn > --- > src/lxc/utils.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/lxc/utils.h b/src/lxc/utils.h > index cd08f05..20853b2 100644 > --- a/src/lxc/utils.h > +++ b/src/lxc/

Re: [lxc-devel] [PATCH 06/17] Add arm defines for __NR_signalfd(4)

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn > --- > src/lxc/utils.h | 4 > 1 file changed, 4 insertions(+) > > diff --git a/src/lxc/utils.h b/src/lxc/utils.h > index 1818ee3..cd08f05 100644 > --- a/src/lxc/utils.h > +++ b/src/

Re: [lxc-devel] [PATCH 05/17] Android now uses a sane clone() definition

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > The current Android NDK provides a clone() defintion that's identical to Does this mean this will break older androids? Or is that not how it works? > eglibc's so we can drop the ifdef from that one. > > Signed-off-by: Stéphane Graber Acked-by:

Re: [lxc-devel] [PATCH 04/17] Define BLKGETSIZE64 and LO_FLAGS_AUTOCLEAR

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > Those two aren't always around (specifically on bionic), so add some > defines in case they aren't already defined. > > Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn > --- > src/lxc/bdev.c | 8 > 1 file changed, 8 insertions

Re: [lxc-devel] [PATCH 02/17] Replace all calls to rindex by strrchr

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > The two functions are identical but strrchr also works on Bionic. But I like 'rindex' so much better :) > > Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn > --- > src/lxc/bdev.c | 12 ++-- > src/lxc/cgroup.c |

Re: [lxc-devel] [PATCH 01/17] Add a local implementation of ifaddrs.h

2013-08-16 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > This adds a local ifaddrs implementation to be used on Bionic or other C > libraries that don't come with a getifaddrs implementation. > > This code was written by Kenneth MacKay and is under a two-clause BSD > license (copyright information in the

[lxc-devel] [PATCH 00/17] Android/Bionic compatibility changes

2013-08-16 Thread Stéphane Graber
LXC recently regressed with regard to Android/Bionic buildability, the following commits try to address that. With those changes, LXC now builds with an up to date NDK using android-9. Stéphane Graber (17): Add a local implementation of ifaddrs.h Replace all calls to rindex by strrchr Expor

[lxc-devel] [PATCH 02/17] Replace all calls to rindex by strrchr

2013-08-16 Thread Stéphane Graber
The two functions are identical but strrchr also works on Bionic. Signed-off-by: Stéphane Graber --- src/lxc/bdev.c | 12 ++-- src/lxc/cgroup.c | 4 ++-- src/lxc/lxccontainer.c | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lxc/bdev.c b/s

[lxc-devel] [PATCH 10/17] Include stdio.h in getline.h for FILE

2013-08-16 Thread Stéphane Graber
Signed-off-by: Stéphane Graber --- src/include/getline.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/include/getline.h b/src/include/getline.h index b030d7a..23d6f04 100644 --- a/src/include/getline.h +++ b/src/include/getline.h @@ -1,6 +1,8 @@ #ifndef _getline_h #define _getline_

[lxc-devel] [PATCH 01/17] Add a local implementation of ifaddrs.h

2013-08-16 Thread Stéphane Graber
This adds a local ifaddrs implementation to be used on Bionic or other C libraries that don't come with a getifaddrs implementation. This code was written by Kenneth MacKay and is under a two-clause BSD license (copyright information in the file headers). Signed-off-by: Stéphane Graber --- conf

[lxc-devel] [PATCH 07/17] Add missing syscall.h include to utils.h

2013-08-16 Thread Stéphane Graber
Signed-off-by: Stéphane Graber --- src/lxc/utils.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lxc/utils.h b/src/lxc/utils.h index cd08f05..20853b2 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -25,6 +25,7 @@ #include #include +#include #include #include #include "

[lxc-devel] [PATCH 06/17] Add arm defines for __NR_signalfd(4)

2013-08-16 Thread Stéphane Graber
Signed-off-by: Stéphane Graber --- src/lxc/utils.h | 4 1 file changed, 4 insertions(+) diff --git a/src/lxc/utils.h b/src/lxc/utils.h index 1818ee3..cd08f05 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -114,6 +114,8 @@ struct signalfd_siginfo # define __NR_signalfd4 313 #

[lxc-devel] [PATCH 14/17] Don't define new_personality when building without personalities

2013-08-16 Thread Stéphane Graber
Signed-off-by: Stéphane Graber --- src/lxc/attach.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 99b9c89..19fe61d 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -830,7 +830,9 @@ int attach_child_main(void* data) int ipc_socket =

[lxc-devel] [PATCH 13/17] Add missing sys/socket.h include

2013-08-16 Thread Stéphane Graber
Signed-off-by: Stéphane Graber --- src/lxc/attach.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 3e9fb5f..99b9c89 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #includ

[lxc-devel] [PATCH 05/17] Android now uses a sane clone() definition

2013-08-16 Thread Stéphane Graber
The current Android NDK provides a clone() defintion that's identical to eglibc's so we can drop the ifdef from that one. Signed-off-by: Stéphane Graber --- src/lxc/namespace.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/lxc/namespace.h b/src/lxc/namespace.h index c6a97ec..0c53630

[lxc-devel] [PATCH 11/17] Use srand/rand instead of initstate/random

2013-08-16 Thread Stéphane Graber
initstate/random doesn't work on bionic, srand/rand works on everything, so let's use that. Signed-off-by: Stéphane Graber --- src/lxc/conf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 867a150..3d99469 100644 --- a/src/lxc/conf.

[lxc-devel] [PATCH 17/17] Fix lxc-user-nic to work on bionic

2013-08-16 Thread Stéphane Graber
This adds a couple of missing includes, uses the local version of getline on bionic and replaces getpwuid_r by getpwuid. Signed-off-by: Stéphane Graber --- src/lxc/lxc_user_nic.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/lxc/lxc_user_nic.c b/src/

[lxc-devel] [PATCH 15/17] Allow building without confstr

2013-08-16 Thread Stéphane Graber
We use confstr to grab the default PATH value. If it's not there, just use a standard one with bin and sbin for /, /usr and /usr/local. Signed-off-by: Stéphane Graber --- configure.ac | 2 +- src/lxc/attach.c | 9 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/confi

[lxc-devel] [PATCH 12/17] Define SOCK_CLOEXEC when missing

2013-08-16 Thread Stéphane Graber
Signed-off-by: Stéphane Graber --- src/lxc/attach.c | 4 1 file changed, 4 insertions(+) diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 950fe9a..3e9fb5f 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -54,6 +54,10 @@ #include #endif +#ifndef SOCK_CLOEXEC +# define SOCK

[lxc-devel] [PATCH 09/17] Import local getline copy on bionic

2013-08-16 Thread Stéphane Graber
Signed-off-by: Stéphane Graber --- src/lxc/cgroup.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c index b2b1aa3..221c018 100644 --- a/src/lxc/cgroup.c +++ b/src/lxc/cgroup.c @@ -53,6 +53,12 @@ #include #endif +#ifndef HAVE_GETLINE +#ifdef HAVE_

[lxc-devel] [PATCH 08/17] Add missing sys/select.h include for fd_set

2013-08-16 Thread Stéphane Graber
Signed-off-by: Stéphane Graber --- src/lxc/lxc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lxc/lxc.h b/src/lxc/lxc.h index b9eb52c..253c440 100644 --- a/src/lxc/lxc.h +++ b/src/lxc/lxc.h @@ -28,6 +28,7 @@ extern "C" { #endif #include +#include #include #include -- 1.8.3

[lxc-devel] [PATCH 03/17] Export the local getmntent_r implementation

2013-08-16 Thread Stéphane Graber
New code now uses getmntent_r so we need it exported so that it can be used when building on bionic. Signed-off-by: Stéphane Graber --- src/include/lxcmntent.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/include/lxcmntent.h b/src/include/lxcmntent.h index 528e8bc..5d84419 100644 ---

[lxc-devel] [PATCH 16/17] Add missing namespace.h include

2013-08-16 Thread Stéphane Graber
Signed-off-by: Stéphane Graber --- src/lxc/lxccontainer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index a64babe..39789fd 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -42,6 +42,7 @@ #include "attach.h" #include

[lxc-devel] [PATCH 04/17] Define BLKGETSIZE64 and LO_FLAGS_AUTOCLEAR

2013-08-16 Thread Stéphane Graber
Those two aren't always around (specifically on bionic), so add some defines in case they aren't already defined. Signed-off-by: Stéphane Graber --- src/lxc/bdev.c | 8 1 file changed, 8 insertions(+) diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index e244550..2ce7de2 100644 --- a/src/

[lxc-devel] tracking overlayfs dependencies

2013-08-16 Thread Serge Hallyn
Hi, snapshotted containers aren't an issue with btrfs, zfs, or lvm. In btrfs you can delete the original and the snapshot will continue to work. zfs and lvm will both prevent removal of the original while there are snapshots. overlayfs doesn't do this. So we need to teach lxc-delete to do it f