Merge git://github.com/lxc/lxc

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
Change author email address

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
lxc-0.9.0.rc1

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
Build fix for ia64: Declare __clone2 in lxc/namespace.h

Signed-off-by: Dennis Schridde <devurandom@gmx.net>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Properly cleanup network devices if pinning root filesystem didn't work

Signed-off-by: Christian Seiler <christian@iwakd.de>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Fix for ia64: Use __clone2 for ia64 in lxc/start.c

Signed-off-by: Dennis Schridde <devurandom@gmx.net>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Properly handle timeout case in lxc-shutdown

Signed-off-by: Christian Seiler <christian@iwakd.de>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Use $localstatedir/log/lxc for default log path

When we install lxc by manual (configure; make; make install),
all files are installed under /usr/local/. Configuration files
and setting files of containers are stored under /usr/local/ too,
however, only log files are stored under /var/log/ not
/usr/local/var/log.

This patch changes the default log path to $localstatedir/log/lxc
(by default $localstatedir is /usr/local/var) where is an ordinary
directory, which is probably expected and unsurprising.

Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
lxc-attach: Clear environment and set container=lxc

The child process's environment should be manipulated the same way
by lxc-attach as it would be by lxc-start or lxc-execute.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
python: Fix runtime failure on armhf

Recent testing on Ubuntu armhf showed that the python module was
failing to import. After some time tracking the issue down, the problem
was identified as being a non-terminated list of get/setters.

This commit fixes that issue as well as a few other potential ones that
were identified during debugging.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
EXTRA_DIST: Fix missing files with "make dist"

I recently noticed that the generated tarballs with "make dist"
were incomplete unless the configure script was run on a machine
with all possible build dependencies.

That's wrong as you clearly don't need those dependencies to generate
the tarball. This change fixes that.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Fix 'make clean'

This is mostly to make debuild happy as it doesn't tolerate any
leftover file when building twice in a row.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
ubuntu: Tweak architecture support

This updates the various checks to match the grid below:

== lxc-ubuntu support per architecture ==
amd64: amd64, i386, armel, armhf, powerpc
i386: i386, armel, armhf, powerpc
armel: armel, armhf
armhf: armhf, armel
powerpc: powerpc

== lxc-ubuntu-cloud support per architecture ==
amd64: amd64, i386
i386: i386
armel: armel, armhf
armhf: armhf, armel

Note that most of the foreign architectures on x86 are supported
through the use of qemu-user-static. This one however isn't yet
support for cloud images (I'll send a patch for 1.0).

Also, qemu-user-static is technically able to emulate amd64 on i386
but qemu-debootstrap doesn't appear to know that and fails quite miserably.

We may also want to add a test for amd64 kernel but i386 userspace, which
is a valid combination that allows running an amd64 container on an i386
host without requiring emulation, but that's for another patch.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Set all mounts to MS_SLAVE when starting a container without a rootfs

If the filesystem mounts on the host have the MS_SHARED or MS_SLAVE
flag set, and a container without a rootfs is started, then any new
mounts created inside the container are currently propagated into
the host. In addition to mounts placed in the configuration file of
the container or performed manually after startup, the automatic
mounting of /proc by lxc-execute will propagate back into the host,
effectively crippling the entire system. This can be prevented by
setting the MS_SLAVE flag on all mounts (inside the container's own
mount namespace) during startup if a rootfs is not configured.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
lxc-start-ephemeral: Implement -n to match manpage

The -n/--name option of lxc-start-ephemeral was never implemented
even though it was documented in the manpage.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
lxc-clone: support 'permanent ephemeral' containers

All of this needs a rewrite/redesign, and that will be coming (details
below), but for now

You can start 'non-ephemeral ephemeral' containers using

	lxc-start-ephemeral -o oldname -n newname --keep-data

When you shut that down, the container stick around and can be
restarted.  Now lxc-clone will recognize such a container by the
presence of the delta0/ which contains the read-write overlayfs
layer.  This means you can do incremental development of containers,
i.e.

	lxc-create -t ubuntu -n r1
	lxc-start-ephemeral --keep-data -o r1 -n r1-2
	# make some changes, poweroff
	lxc-clone -o r1-2 -n r1-3
	# make some changes...
	lxc-clone -o r1-3 -n r1-4
	# etc...

Now, as for design changes...  from a higher level

	1. lxc-clone should be re-written in c and exported through the
	   api.
	2. lxc-clone should support overlayfs and aufs
	3. lxc-start-ephemeral should become a thin layer which clones a
	   container, starts and stops and destroys it.

at a lower level,

	1. the api should support container->setup_mounts
	2. lxc-clone should be written as a set of backend classes which
	   can copy mounts to each other.  So when you load a container
	   which is lvm-backed, it creates a lvm backend class.  That
	   class instance can be converted into a loopback or qemu-nbd
	   or directory backed class.  A directory-backed class can be
	   converted into a overlayfs or aufs backed class, which (a)
	   uses the dirctory-backed class as the read-only base, and (b)
	   pins the base container (so it can't be deleted until all
	   snapshots are deleted).

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc.sgml.in: Fix typo in man page.

This patch fixes a small typo in the man page.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
rcfile shouldn't be recorded in lxc_conf if the attempt to load a config file fails

Though it's more subtle than that.  If the file doesn't exist or we
can't access it, then don't record it.  But if we have parse errors,
then do.

This is mainly to help out API users who try to read a container
configuration file before calling c->create().  If the file doesn't
exist, then without this patch the subsequent create() will not
use the default /etc/lxc/default.conf.  The API user could check
for the file ahead of time, but this check makes his life easier
without costing us anything.

Signed-off-by: S.Çağlar Onur" <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>