]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
9 years agouse snprintf instead of strncat 932/head
Niklas Eiling [Wed, 30 Mar 2016 21:28:43 +0000 (23:28 +0200)] 
use snprintf instead of strncat

Signed-off-by: Niklas Eiling <niklas.eiling@rwth-aachen.de>
9 years agofix possible buffer overflow
Niklas Eiling [Wed, 30 Mar 2016 18:10:21 +0000 (20:10 +0200)] 
fix possible buffer overflow
strncat only returns its first argument and not the end of the written string.
Thus "buf-pos" is always 0 and consquently no range check is performed.

Signed-off-by: Niklas Eiling <niklas.eiling@rwth-aachen.de>
9 years agoMerge pull request #929 from brauner/2016-03-27/mmap_file_to_str
Serge Hallyn [Wed, 30 Mar 2016 16:19:44 +0000 (11:19 -0500)] 
Merge pull request #929 from brauner/2016-03-27/mmap_file_to_str

use smarter error handling for lxc_strmmap()

9 years agouse common lxc ordering for included headers 929/head
Christian Brauner [Wed, 30 Mar 2016 16:07:38 +0000 (18:07 +0200)] 
use common lxc ordering for included headers

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agoMerge pull request #930 from brauner/2016-03-30/ignore_all_so
Serge Hallyn [Wed, 30 Mar 2016 16:06:02 +0000 (11:06 -0500)] 
Merge pull request #930 from brauner/2016-03-30/ignore_all_so

also ingore *.so.*

9 years agouse smarter error handling for lxc_strmmap()
Christian Brauner [Wed, 30 Mar 2016 05:57:34 +0000 (07:57 +0200)] 
use smarter error handling for lxc_strmmap()

Additionally, fix the comment for lxc_strmmap() and cleanup #includes in
utils.{c,h}.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agoalso ingore *.so.* 930/head
Christian Brauner [Wed, 30 Mar 2016 08:17:39 +0000 (10:17 +0200)] 
also ingore *.so.*

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agoMerge pull request #928 from stgraber/master
Christian Brauner [Wed, 30 Mar 2016 05:49:55 +0000 (07:49 +0200)] 
Merge pull request #928 from stgraber/master

lxc-ubuntu: Fix building on secondary architectures

9 years agolxc-ubuntu: Fix building on secondary architectures 928/head
Stéphane Graber [Wed, 30 Mar 2016 05:25:53 +0000 (01:25 -0400)] 
lxc-ubuntu: Fix building on secondary architectures

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agochange version to 2.0.0.rc14 in configure.ac lxc-2.0.0.rc14
Stéphane Graber [Wed, 30 Mar 2016 01:31:14 +0000 (21:31 -0400)] 
change version to 2.0.0.rc14 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoMerge pull request #926 from brauner/2016-03-27/mmap_file_to_str
Serge Hallyn [Tue, 29 Mar 2016 16:11:37 +0000 (11:11 -0500)] 
Merge pull request #926 from brauner/2016-03-27/mmap_file_to_str

add funs to mmap() files to \0-terminated strings

9 years agobetter naming for mmap helpers 926/head
Christian Brauner [Tue, 29 Mar 2016 06:50:27 +0000 (08:50 +0200)] 
better naming for mmap helpers

Rename lxc_mmap()/lxc_munmap() to lxc_strmmap()/lxc_strmunmap().

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agouse lxc_mmap() and lxc_munmap()
Christian Brauner [Sun, 27 Mar 2016 16:42:24 +0000 (18:42 +0200)] 
use lxc_mmap() and lxc_munmap()

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agoadd funs to mmap() files to \0-terminated strings
Christian Brauner [Sun, 27 Mar 2016 16:41:51 +0000 (18:41 +0200)] 
add funs to mmap() files to \0-terminated strings

In order to do this we make use of the MAP_FIXED flag of mmap(). MAP_FIXED
should be safe to use when it replaces an already existing mapping. To this
end, we establish an anonymous mapping that is one byte larger than the
underlying file. The pages handed to us are zero filled.  Now we establish a
fixed-address mapping starting at the address we received from our anonymous
mapping and replace all bytes excluding the additional \0-byte with the file.
This allows us to use normal string-handling function. The idea implemented
here is similar to how shared libraries are mapped.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agoMerge pull request #927 from tych0/only-use-host-devnull-no-autodev
Stéphane Graber [Tue, 29 Mar 2016 05:25:51 +0000 (01:25 -0400)] 
Merge pull request #927 from tych0/only-use-host-devnull-no-autodev

start: only use host's /dev/null when absolutely necessary

9 years agostart: only use host's /dev/null when absolutely necessary 927/head
Tycho Andersen [Tue, 29 Mar 2016 00:43:20 +0000 (18:43 -0600)] 
start: only use host's /dev/null when absolutely necessary

See comments for details, but basically, only use the host's /dev/null when
absolutely necessary (i.e. there is no reasonable /dev/null in the
container).

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
9 years agoMerge pull request #924 from evgeni/default-ubuntu-mirror
Stéphane Graber [Sat, 26 Mar 2016 17:05:51 +0000 (13:05 -0400)] 
Merge pull request #924 from evgeni/default-ubuntu-mirror

always provide a default mirror for debootstraping Ubuntu

9 years agoMerge pull request #925 from evgeni/debian-main-only
Stéphane Graber [Sat, 26 Mar 2016 17:04:58 +0000 (13:04 -0400)] 
Merge pull request #925 from evgeni/debian-main-only

only enable Debian's main repository by default

9 years agoonly enable Debian's main repository by default 925/head
Evgeni Golov [Sat, 26 Mar 2016 10:28:52 +0000 (11:28 +0100)] 
only enable Debian's main repository by default

This inverts the logic done in c2a85d0 to default to "main only" and allow enabling contrib and non-free on user request.

Closes: #625
Signed-off-by: Evgeni Golov <evgeni@debian.org>
9 years agoalways provide a default mirror for debootstraping Ubuntu 924/head
Evgeni Golov [Sat, 26 Mar 2016 09:52:32 +0000 (10:52 +0100)] 
always provide a default mirror for debootstraping Ubuntu

debootstrap sometimes selects the wrong mirror due to [1]

[1] https://bugs.debian.org/819300

Signed-off-by: Evgeni Golov <evgeni@debian.org>
9 years agoMerge pull request #922 from evgeni/httpredir.debian.org
Christian Brauner [Sat, 26 Mar 2016 09:13:58 +0000 (10:13 +0100)] 
Merge pull request #922 from evgeni/httpredir.debian.org

use httpredir.debian.org as the default Debian mirror

9 years agouse httpredir.debian.org as the default Debian mirror 922/head
Evgeni Golov [Sat, 26 Mar 2016 08:46:13 +0000 (09:46 +0100)] 
use httpredir.debian.org as the default Debian mirror

http.debian.net is an alias anyways and httpredir.debian.org is the official name of the service

Signed-off-by: Evgeni Golov <evgeni@debian.org>
9 years agoMerge pull request #920 from thtanaka/timezone-fix
Christian Brauner [Fri, 25 Mar 2016 17:18:10 +0000 (18:18 +0100)] 
Merge pull request #920 from thtanaka/timezone-fix

Timezone inside the container is not the same as the host

9 years agoMerge pull request #919 from amezin/master
Christian Brauner [Fri, 25 Mar 2016 17:13:47 +0000 (18:13 +0100)] 
Merge pull request #919 from amezin/master

Fix installation of out-of-tree (VPATH) builds

9 years agoTimezone inside the container is not the same as the host 920/head
Thomas Tanaka [Fri, 25 Mar 2016 16:53:33 +0000 (09:53 -0700)] 
Timezone inside the container is not the same as the host

In OL6, it is missing /etc/sysconfig/clock

Tested-by: Deepak Patel <deepak.patel@oracle.com>
Signed-off-by: Thomas Tanaka <thomas.tanaka@oracle.com>
9 years agoFix installation of out-of-tree (VPATH) builds 919/head
Aleksandr Mezin [Fri, 25 Mar 2016 13:30:49 +0000 (19:30 +0600)] 
Fix installation of out-of-tree (VPATH) builds

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
9 years agoMerge pull request #917 from amezin/master
Serge Hallyn [Fri, 25 Mar 2016 04:45:15 +0000 (21:45 -0700)] 
Merge pull request #917 from amezin/master

Fix daemonized containers without autodev and/or /dev mount

9 years agostart: open /dev/null from "host" /dev 917/head
Aleksandr Mezin [Thu, 24 Mar 2016 17:22:32 +0000 (23:22 +0600)] 
start: open /dev/null from "host" /dev

Sometimes, a container doesn't have /dev/null.
For example, I have this problem with Android container.

This fixes #910 (github) for me.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
9 years agoutils: split null_stdfds() to open_devnull() and set_stdfds()
Aleksandr Mezin [Thu, 24 Mar 2016 17:20:42 +0000 (23:20 +0600)] 
utils: split null_stdfds() to open_devnull() and set_stdfds()

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
9 years agolxc-busybox: Remove warning for dynamically linked Busybox
Bogdan Purcareata [Thu, 24 Mar 2016 11:54:27 +0000 (11:54 +0000)] 
lxc-busybox: Remove warning for dynamically linked Busybox

The warning has been present since commit 32b37181ea (with no purpose stated).
Support for dynamically linked Busybox has been added since commit bf6cc73696.
Haven't encountered any issues with dynamically linked Busybox in my last
2 years' testing.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoMerge pull request #916 from ojkastl/20160324_Fix_path_to_lxc-net_config
Stéphane Graber [Thu, 24 Mar 2016 16:38:51 +0000 (12:38 -0400)] 
Merge pull request #916 from ojkastl/20160324_Fix_path_to_lxc-net_config

lxc.spec.in: fixed hardcoded path to lxc-net config file

9 years agostart: use LXC_SYNC_ERROR to report errors.
Aleksandr Mezin [Thu, 24 Mar 2016 11:55:03 +0000 (17:55 +0600)] 
start: use LXC_SYNC_ERROR to report errors.

This gives more meaningful error message than "invalid sequence".

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
9 years agosync: add LXC_SYNC_ERROR to report errors from another process.
Aleksandr Mezin [Thu, 24 Mar 2016 11:54:26 +0000 (17:54 +0600)] 
sync: add LXC_SYNC_ERROR to report errors from another process.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
9 years agolxc.spec.in: fixed hardcoded path to lxc-net config file 916/head
Johannes Kastl [Thu, 24 Mar 2016 08:26:28 +0000 (09:26 +0100)] 
lxc.spec.in: fixed hardcoded path to lxc-net config file

Signed-off-by: Johannes Kastl <git@ojkastl.de>
9 years agoMerge pull request #914 from brauner/2016-03-23/Purcarea_Bogdan
Christian Brauner [Thu, 24 Mar 2016 07:13:12 +0000 (08:13 +0100)] 
Merge pull request #914 from brauner/2016-03-23/Purcarea_Bogdan

lxc-busybox: Touch /etc/fstab in the container rootfs

9 years agolxc-busybox: Touch /etc/fstab in the container rootfs 914/head
Bogdan Purcareata [Tue, 22 Mar 2016 13:33:57 +0000 (13:33 +0000)] 
lxc-busybox: Touch /etc/fstab in the container rootfs

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
9 years agoMerge pull request #911 from brauner/2016-03-23/Purcarea_Bogdan
Serge Hallyn [Wed, 23 Mar 2016 16:53:35 +0000 (09:53 -0700)] 
Merge pull request #911 from brauner/2016-03-23/Purcarea_Bogdan

open_without_symlink: Don't SYSERROR on something else than ELOOP

9 years agoopen_without_symlink: Don't SYSERROR on something else than ELOOP 911/head
Christian Brauner [Wed, 23 Mar 2016 15:37:09 +0000 (16:37 +0100)] 
open_without_symlink: Don't SYSERROR on something else than ELOOP

The open_without_symlink routine has been specifically created to prevent
mounts with synlinks as source or destination. Keep SYSERROR'ing in that
particular scenario, but leave error handling to calling functions for the
other ones - e.g. optional bind mount when the source dir doesn't exist
throws a nasty error.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
9 years agochange version to 2.0.0.rc13 in configure.ac lxc-2.0.0.rc13
Stéphane Graber [Tue, 22 Mar 2016 21:22:23 +0000 (17:22 -0400)] 
change version to 2.0.0.rc13 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoMerge pull request #908 from tych0/fix-907
Christian Brauner [Tue, 22 Mar 2016 15:47:00 +0000 (16:47 +0100)] 
Merge pull request #908 from tych0/fix-907

Fix 907

9 years agoc/r: rename restore & friends to __criu_restore 908/head
Tycho Andersen [Tue, 22 Mar 2016 15:24:01 +0000 (09:24 -0600)] 
c/r: rename restore & friends to __criu_restore

Hopefully this will avoid name collisions with any user binaries, since
criu is just an implementation detail.

Closes #907

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
9 years agolxc-checkpoint: make things static when they can be
Tycho Andersen [Tue, 22 Mar 2016 15:22:39 +0000 (09:22 -0600)] 
lxc-checkpoint: make things static when they can be

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
9 years agoMerge pull request #906 from tych0/fix-console-none-migration
Serge Hallyn [Mon, 21 Mar 2016 23:39:05 +0000 (16:39 -0700)] 
Merge pull request #906 from tych0/fix-console-none-migration

Fix console none migration

9 years agoc/r: don't fail if there is no console_fd on restore 906/head
Tycho Andersen [Mon, 21 Mar 2016 22:52:02 +0000 (16:52 -0600)] 
c/r: don't fail if there is no console_fd on restore

If we set lxc.console=none, this fd won't exist, so let's not fail if it
doesn't. We already partially handled this case correctly, so let's
actually handle it correctly :)

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
9 years agoc/r: don't pass --ext-mount-map flag when console=none
Tycho Andersen [Mon, 21 Mar 2016 22:50:39 +0000 (16:50 -0600)] 
c/r: don't pass --ext-mount-map flag when console=none

We don't pass anything on the restore side since we didn't save anything,
but the restore side will expect something if we pass this. Instead, let's
not pass anything.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
9 years agochange version to 2.0.0.rc12 in configure.ac lxc-2.0.0.rc12
Stéphane Graber [Mon, 21 Mar 2016 20:44:45 +0000 (16:44 -0400)] 
change version to 2.0.0.rc12 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoMerge pull request #902 from tych0/better-criu-logging
Stéphane Graber [Fri, 18 Mar 2016 20:12:45 +0000 (16:12 -0400)] 
Merge pull request #902 from tych0/better-criu-logging

Better criu logging

9 years agoc/r: print criu's stdout when it fails 902/head
Tycho Andersen [Fri, 18 Mar 2016 19:13:17 +0000 (13:13 -0600)] 
c/r: print criu's stdout when it fails

In particular, when CRIU fails before it has its log completely initialized
(e.g. if the log directory doesn't exist, or if the argument parser fails),
it prints this to stdout. Let's log that.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
9 years agoc/r: log the exact command we exec
Tycho Andersen [Fri, 18 Mar 2016 16:19:36 +0000 (10:19 -0600)] 
c/r: log the exact command we exec

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
9 years agochange version to 2.0.0.rc11 in configure.ac lxc-2.0.0.rc11
Stéphane Graber [Fri, 18 Mar 2016 03:11:50 +0000 (23:11 -0400)] 
change version to 2.0.0.rc11 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoMerge pull request #901 from stgraber/master
Christian Brauner [Thu, 17 Mar 2016 22:01:45 +0000 (23:01 +0100)] 
Merge pull request #901 from stgraber/master

download: Bump to compat level 3

9 years agodownload: Bump to compat level 3 901/head
Stéphane Graber [Thu, 17 Mar 2016 21:41:14 +0000 (17:41 -0400)] 
download: Bump to compat level 3

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoMerge pull request #900 from tych0/dont-always-create-console
Stéphane Graber [Thu, 17 Mar 2016 20:02:47 +0000 (16:02 -0400)] 
Merge pull request #900 from tych0/dont-always-create-console

autodev: don't always create /dev/console

9 years agoautodev: don't always create /dev/console 900/head
Tycho Andersen [Thu, 17 Mar 2016 11:14:43 +0000 (05:14 -0600)] 
autodev: don't always create /dev/console

In particular, only create /dev/console when it is set to "none".
Otherwise, we will bind mount a pts device later, so let's just leave it.

Also, when bind mounting the pts device, let's create /dev/console if it
doesn't exist, since it may not already exist due to the above :)

v2: s/ot/to
v3: add O_EXCL so we actually get EEXIST, use the right condition for
    mount_console (we want to compare against console.path, not
    console.name, and console.path can be null)

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
9 years agoMerge pull request #899 from hallyn/2016-03-16/cgroupauto.2
Stéphane Graber [Thu, 17 Mar 2016 06:53:44 +0000 (02:53 -0400)] 
Merge pull request #899 from hallyn/2016-03-16/cgroupauto.2

cgfsng: include sys/mount.h

9 years agocgfsng: two fixes for cgroup-full 899/head
Serge Hallyn [Thu, 17 Mar 2016 06:12:57 +0000 (23:12 -0700)] 
cgfsng: two fixes for cgroup-full

We need to pass nosuid+nexec+nodev to remount to stop the kernel
from denying it.

When remounting the container's path read-write, use the right dest
path.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoinclude bdev.h
Serge Hallyn [Thu, 17 Mar 2016 04:27:24 +0000 (21:27 -0700)] 
include bdev.h

for the define of RELATIME for android

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agouse hierarchy base path not just controller cgroup
Serge Hallyn [Thu, 17 Mar 2016 04:22:00 +0000 (21:22 -0700)] 
use hierarchy base path not just controller cgroup

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agocgfsng: include sys/mount.h
Serge Hallyn [Thu, 17 Mar 2016 03:54:38 +0000 (20:54 -0700)] 
cgfsng: include sys/mount.h

to hopefully define RELATIME for android

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #898 from hallyn/2016-03-16/cgroupauto
Stéphane Graber [Thu, 17 Mar 2016 02:58:33 +0000 (22:58 -0400)] 
Merge pull request #898 from hallyn/2016-03-16/cgroupauto

2016 03 16/cgroupauto

9 years agono variable decl in for loop 898/head
Serge Hallyn [Thu, 17 Mar 2016 02:05:06 +0000 (19:05 -0700)] 
no variable decl in for loop

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agocgroups: try to load cgmanager first
Serge Hallyn [Wed, 16 Mar 2016 06:02:10 +0000 (23:02 -0700)] 
cgroups: try to load cgmanager first

If cgmanager is running, use it.  This allows the admin to simply
stop cgmanager if they don't want to use it.  The other way there
is no way to choose to use cgmanager.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoimplement lxc.mount.auto = cgroup for cgfsng
Serge Hallyn [Wed, 16 Mar 2016 06:01:42 +0000 (23:01 -0700)] 
implement lxc.mount.auto = cgroup for cgfsng

Also add testcase for each of the cgroup{,-full}:{rw,ro,mixed} cases.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #897 from hallyn/2016-03-16/aa
Christian Brauner [Wed, 16 Mar 2016 22:35:34 +0000 (23:35 +0100)] 
Merge pull request #897 from hallyn/2016-03-16/aa

Prevent access to pci devices

9 years agoPrevent access to pci devices 897/head
Serge Hallyn [Wed, 16 Mar 2016 21:48:49 +0000 (14:48 -0700)] 
Prevent access to pci devices

Prevent privileged containers from messing with the host's pci devices
directly.  Refuse access under /proc/bus, and drop cap_sys_rawio.  Some
containers may need to re-enable cap_sys_rawio (i.e. if they run an
X server).

It may be desirable to break some of this stuff into files which can be
separately included (or not included), but this patch isn't the right
place for that.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #896 from hallyn/2016-03-15/nest
Stéphane Graber [Tue, 15 Mar 2016 22:21:12 +0000 (18:21 -0400)] 
Merge pull request #896 from hallyn/2016-03-15/nest

2016 03 15/nest

9 years agonesting: remove the nesting hint from configuration templates 896/head
Serge Hallyn [Tue, 15 Mar 2016 21:47:44 +0000 (14:47 -0700)] 
nesting: remove the nesting hint from configuration templates

we're having it inserted in every config by the lxcapi_create
itself.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agonesting: document how to enable nesting in container configurations
Serge Hallyn [Tue, 15 Mar 2016 21:43:44 +0000 (14:43 -0700)] 
nesting: document how to enable nesting in container configurations

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #895 from tych0/fix-android-build
Stéphane Graber [Tue, 15 Mar 2016 18:21:01 +0000 (14:21 -0400)] 
Merge pull request #895 from tych0/fix-android-build

build: fix build on android (and ppc)

9 years agobuild: fix build on android (and ppc) 895/head
Tycho Andersen [Tue, 15 Mar 2016 18:01:36 +0000 (12:01 -0600)] 
build: fix build on android (and ppc)

The problem here is that dev_t on most platforms is `long unsigned`, but on
android (and ppc?) it's `long long unsigned`. Let's just upcast to `long
long unsigned` and use that format string to keep the compilers happy.

Safety first!

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
9 years agoMerge pull request #893 from tych0/dont-require-dev-console-none
Stéphane Graber [Tue, 15 Mar 2016 17:32:49 +0000 (13:32 -0400)] 
Merge pull request #893 from tych0/dont-require-dev-console-none

Dont require dev console none

9 years agoc/r: drop lxc.console=none config requirement 893/head
Tycho Andersen [Sat, 12 Mar 2016 01:10:40 +0000 (18:10 -0700)] 
c/r: drop lxc.console=none config requirement

There are a few things going on in this patch.

1. /dev/console is an external mount since it is bind mounted from the
   host. However, we don't want to use criu's --ext-mount-map auto handling
   here, because that will bind mount exactly the same path from the host
   on restore, but if the pts device is different on the target host, we'll
   bind mount the wrong one, which is obviously wrong.

2. We need to tell CRIU how to restore the TTY. Since we declare the tty as
   --external, we need to provide it via --inherit-fd (even though we've
   already fixed up the environment).

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
9 years agocriu: hide more stuff in criu.c
Tycho Andersen [Sat, 12 Mar 2016 02:01:43 +0000 (19:01 -0700)] 
criu: hide more stuff in criu.c

Various other functions/structures are now only used in criu.c, so let's
hide stuff there so as not to pollute headers.

This commit also bumps the required CRIU versions to 2.0. While we don't
*require* any features that aren't in 1.8 patchlevel 21 or above, 2.0 is a
vast improvement, and so we should use that instead.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
9 years agochange version to 2.0.0.rc10 in configure.ac lxc-2.0.0.rc10
Stéphane Graber [Fri, 11 Mar 2016 06:16:54 +0000 (01:16 -0500)] 
change version to 2.0.0.rc10 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoMerge pull request #892 from hallyn/2016-03-10/tasks
Stéphane Graber [Fri, 11 Mar 2016 05:23:49 +0000 (00:23 -0500)] 
Merge pull request #892 from hallyn/2016-03-10/tasks

cgfsng: chmod the tasks and procns files

9 years agocgfsng: fix inverse null check 892/head
Serge Hallyn [Fri, 11 Mar 2016 04:40:47 +0000 (20:40 -0800)] 
cgfsng: fix inverse null check

remove the hierarchy if the fullcgpath is NOT null.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agocgfsng: chmod the tasks and procns files
Serge Hallyn [Fri, 11 Mar 2016 04:24:43 +0000 (20:24 -0800)] 
cgfsng: chmod the tasks and procns files

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
---
 Changelog - stgraber points out s/chgrp/chmod and wrong perms

9 years agoMerge pull request #890 from hallyn/2016-03-10/cgfix
Stéphane Graber [Thu, 10 Mar 2016 22:50:56 +0000 (17:50 -0500)] 
Merge pull request #890 from hallyn/2016-03-10/cgfix

cgfsng: get_cgroup_path: return the cgroup path not full mounted path

9 years agocgfsng: get_cgroup_path: return the cgroup path not full mounted path 890/head
Serge Hallyn [Thu, 10 Mar 2016 20:21:55 +0000 (12:21 -0800)] 
cgfsng: get_cgroup_path: return the cgroup path not full mounted path

Add a temporary workaround for talking to containers started with the
buggy monitor.  We can remove it sometime after 2.0 release.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #889 from tych0/cgfsng-fixes
Serge Hallyn [Thu, 10 Mar 2016 19:24:02 +0000 (11:24 -0800)] 
Merge pull request #889 from tych0/cgfsng-fixes

Cgfsng fixes

9 years agocgroup: cgroup_escape takes no arguments 889/head
Tycho Andersen [Thu, 10 Mar 2016 18:10:14 +0000 (11:10 -0700)] 
cgroup: cgroup_escape takes no arguments

cgroup_escape() is a slight abuse of the cgroup code: what we really want
here is to escape the *current* process, whether it happens to be the LXC
monitor or not, into the / cgroups.

In the case of dump, we can't do an lxc_init(), because:

lxc 20160310103501.547 ERROR    lxc_commands - commands.c:lxc_cmd_init:993 - ##
lxc 20160310103501.547 ERROR    lxc_commands - commands.c:lxc_cmd_init:994 - # The container appears to be already running!
lxc 20160310103501.547 ERROR    lxc_commands - commands.c:lxc_cmd_init:995 - ##

We don't want to make this a command to send to the handler, because again,
cgroup_escape() is intended to escape the *current* task to the root
cgroups.

So, let's just have cgroup_escape() build its own handler when required.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
9 years agocriu: make exec_criu static
Tycho Andersen [Thu, 10 Mar 2016 17:54:19 +0000 (10:54 -0700)] 
criu: make exec_criu static

This is no longer needed outside of criu.c with the ->migrate API call, so
let's mark it that way.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
9 years agoMerge pull request #885 from brauner/bugfix_branch
Stéphane Graber [Wed, 9 Mar 2016 17:20:48 +0000 (12:20 -0500)] 
Merge pull request #885 from brauner/bugfix_branch

lxc-attach: update and improve tests

9 years agolxc-attach: update and improve tests 885/head
Christian Brauner [Wed, 9 Mar 2016 14:44:05 +0000 (15:44 +0100)] 
lxc-attach: update and improve tests

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
9 years agochange version to 2.0.0.rc9 in configure.ac lxc-2.0.0.rc9
Stéphane Graber [Wed, 9 Mar 2016 08:02:58 +0000 (03:02 -0500)] 
change version to 2.0.0.rc9 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoMerge pull request #884 from hallyn/2016-03-08/batch
Christian Brauner [Wed, 9 Mar 2016 07:53:03 +0000 (08:53 +0100)] 
Merge pull request #884 from hallyn/2016-03-08/batch

2016 03 08/batch

9 years agocgfsng: make sure a cgroup does not already exist 884/head
Serge Hallyn [Wed, 9 Mar 2016 07:34:19 +0000 (23:34 -0800)] 
cgfsng: make sure a cgroup does not already exist

Our mkdir_p ignore eexist, and of course we want that for
upper path components, but the final directory itself must
not already exist.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agocgfsng: fix real bug and fake libc realloc bug
Serge Hallyn [Wed, 9 Mar 2016 07:04:46 +0000 (23:04 -0800)] 
cgfsng: fix real bug and fake libc realloc bug

read_file was using the wrong value for the string length.  Also,
realloc on i386 is wonky with small sizes - so use a batch size
to avoid small reallocs.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agochange version to 2.0.0.rc8 in configure.ac lxc-2.0.0.rc8
Stéphane Graber [Tue, 8 Mar 2016 22:39:34 +0000 (17:39 -0500)] 
change version to 2.0.0.rc8 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoMerge pull request #883 from hallyn/2016-03-08/cgrouptests
Stéphane Graber [Tue, 8 Mar 2016 22:10:52 +0000 (17:10 -0500)] 
Merge pull request #883 from hallyn/2016-03-08/cgrouptests

tests: set clone_children if need be

9 years agotests: set clone_children if need be 883/head
Serge Hallyn [Tue, 8 Mar 2016 21:44:38 +0000 (13:44 -0800)] 
tests: set clone_children if need be

Lxc only sets it on /lxc, not on /.

It's conceivable that we should really re-set this to the original
value, to prevent making later tests not fail when they should.  I
didn't do that.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #882 from hallyn/2016-03-08/cgfsng.2
Christian Brauner [Tue, 8 Mar 2016 21:19:45 +0000 (22:19 +0100)] 
Merge pull request #882 from hallyn/2016-03-08/cgfsng.2

cgfsng: set cpuset clone_children if needed

9 years agocgfsng: set cpuset clone_children if needed 882/head
Serge Hallyn [Tue, 8 Mar 2016 18:49:16 +0000 (10:49 -0800)] 
cgfsng: set cpuset clone_children if needed

Sigh.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #881 from hallyn/2016-03-08/cgfsng.1
Stéphane Graber [Tue, 8 Mar 2016 17:04:41 +0000 (12:04 -0500)] 
Merge pull request #881 from hallyn/2016-03-08/cgfsng.1

cgfsng: enter/escape error msgs: differentiate and add errno

9 years agocgfsng: enter/escape error msgs: differentiate and add errno 881/head
Serge Hallyn [Tue, 8 Mar 2016 17:02:52 +0000 (09:02 -0800)] 
cgfsng: enter/escape error msgs: differentiate and add errno

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #880 from stgraber/master
Serge Hallyn [Tue, 8 Mar 2016 16:08:53 +0000 (08:08 -0800)] 
Merge pull request #880 from stgraber/master

Remove trailing newlines in log

9 years agoRemove trailing newlines in log 880/head
Stéphane Graber [Tue, 8 Mar 2016 14:50:53 +0000 (09:50 -0500)] 
Remove trailing newlines in log

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoMerge pull request #879 from hallyn/2016-03-07/debug.aa
Stéphane Graber [Tue, 8 Mar 2016 03:13:24 +0000 (22:13 -0500)] 
Merge pull request #879 from hallyn/2016-03-07/debug.aa

prevent containers from reading /sys/kernel/debug

9 years agoprevent containers from reading /sys/kernel/debug 879/head
Serge Hallyn [Tue, 8 Mar 2016 03:10:58 +0000 (19:10 -0800)] 
prevent containers from reading /sys/kernel/debug

Unprivileged containers cannot read it anyway, but also prevent root
owned containers from doing so.  Sadly upstart's mountall won't run
if we try to prevent it from being mounted at all.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agochange version to 2.0.0.rc7 in configure.ac lxc-2.0.0.rc7
Stéphane Graber [Mon, 7 Mar 2016 23:47:50 +0000 (18:47 -0500)] 
change version to 2.0.0.rc7 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>