Commit Graph

4322 Commits

Author SHA1 Message Date
Christian Brauner
39460be89e set lxc.rootfs.backend on container creation
Since specifying lxc.rootfs.backend can lead to performance improvements we
always set it during container creation.

This also fixes a bug. do_bdev_create() tried to be smart and retrieve the lower
directory when bdev->type == overlayfs or aufs thereby cutting the path.
However, this operation is done in ovl_mount() and aufs_mount() and both
functions need the full src path for this. The bug didn't show before because
when creating a overlayfs container with e.g.:

	lxc-create -n c -t busybox -B overlayfs

still left bdev->type set to dir and so the code for retrieving the lower dir in
do_bdev_create() was skipped. But by setting lxc.rootfs.backend on container
creation we force bdev->type to be set to e.g. overlayfs and the code gets
executed thereby exposing the bug.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
2016-04-05 19:23:12 +02:00
Serge Hallyn
a3ff5b5639 Merge pull request #944 from brauner/bugfix_branch
use correct "overlayfs" instead of "ovl"
2016-04-05 09:24:36 -05:00
Christian Brauner
a5b84c6d1a use correct "overlayfs" instead of "ovl"
Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
2016-04-05 16:05:29 +02:00
Stéphane Graber
486c5f03f5 Merge pull request #943 from tenforward/japanese
doc: Add lxc.rootfs.backend in Japanese lxc.container.conf(5)
2016-04-04 22:44:50 -04:00
KATOH Yasufumi
933acbed73 doc: Add lxc.rootfs.backend in Japanese lxc.container.conf(5)
Update for commit f903986

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2016-04-05 11:04:59 +09:00
Stéphane Graber
6f72255b08 Merge pull request #942 from ysbnim/master
Add a document of lxc.rootfs.backend in Korean manpage
2016-04-03 23:04:53 -04:00
Sungbae Yoo
780821f8f6 Add a document of lxc.rootfs.backend in Korean manpage
Update for commit f903986

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
2016-04-04 11:26:19 +09:00
Stéphane Graber
b34944b2ec Merge pull request #941 from evgeni/spelling
fix spelling mistakes spotted by Debian's lintian
2016-04-03 12:57:22 -04:00
Evgeni Golov
e9555a6bc7 fix spelling mistakes spotted by Debian's lintian
Signed-off-by: Evgeni Golov <evgeni@debian.org>
2016-04-03 18:50:16 +02:00
Christian Brauner
7b193c81ac Merge pull request #936 from overlayfs/btrfs_recursive_destroy
fix btrfs_recursive_destroy
2016-04-03 18:35:11 +02:00
Oleg Freedholm
58232f8c30 store errno immediately after ioctl
Signed-off-by: Oleg Freedholm <overlayfs@gmail.com>
2016-04-04 01:15:58 +10:00
Stéphane Graber
89f6299a64 Merge pull request #940 from hallyn/2016-04-02/bdev.4
switch user facing name to lxc.rootfs.backend
2016-04-02 23:52:04 -04:00
Serge Hallyn
f9039861c0 document lxc.rootfs.backend
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-04-02 22:05:09 -05:00
Serge Hallyn
327a1e78e7 switch user facing name to lxc.rootfs.backend
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-04-02 21:32:34 -05:00
Christian Brauner
e82104d3f8 Merge pull request #939 from hallyn/2016-04-02/bdev.3
rootfs.bdev_type: implement get and clear
2016-04-03 04:03:26 +02:00
Serge Hallyn
6a21d4aeac rootfs.bdev_type: implement get and clear
clear is just set(x, ""), but before this patch that didn't work bc
"" is nota valid bdev type.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-04-02 20:43:35 -05:00
Christian Brauner
c78de02c27 Merge pull request #938 from hallyn/2016-04-02/bdev.2
use more accurate bdev_type name for rootfs.bdev
2016-04-02 23:29:07 +02:00
Serge Hallyn
b3b8c97f08 use more accurate bdev_type name for rootfs.bdev
It'll make future code reading easier.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-04-02 16:08:39 -05:00
Christian Brauner
f0a71c4a5d Merge pull request #937 from hallyn/2016-04-02/bdev
2016 04 02/bdev
2016-04-02 23:06:58 +02:00
Serge Hallyn
984bd6203a honor lxc.rootfs.bdev
If that is specified, then we only use the specified backing store type.

This can be useful if you know that lxc.rootfs is a directory type and
you do not want lxc to waste time searching for zfs, btrfs, etc.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-04-02 15:47:43 -05:00
Serge Hallyn
bfd77214f6 add a lxc.rootfs.bdev option (not yet honored)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-04-02 15:41:24 -05:00
Oleg Freedhom
8ba6dc5e53 fix btrfs_recursive_destroy
A change in kernel 4.2 caused btrfs_recursive_destroy to
fail to delete unprivileged containers.  This patch restores
the pre-kernel-4.2 behaviour.  Ref: Issue 935.

Signed-off-by: Oleg Freedhom <overlayfs@gmail.com>
2016-04-02 16:18:54 +00:00
Stéphane Graber
55c91e8367 change version to 2.0.0.rc15 in configure.ac
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-03-31 18:10:51 -04:00
Stéphane Graber
442ad5c61c Merge pull request #931 from n-eiling/pageserver-support
c/r: support for the criu pageserver
2016-03-31 14:50:04 -04:00
Niklas Eiling
74eb576cef fixed indentation and comments
Signed-off-by: Niklas Eiling <niklas.eiling@rwth-aachen.de>
2016-03-31 20:09:42 +02:00
Christian Brauner
5f1728f1f9 Merge pull request #934 from GreatFruitOmsk/master
Fix buffer overflow in do_start()
2016-03-31 12:56:11 +02:00
Aleksandr Mezin
a91cde2199 Fix buffer overflow in do_start()
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-03-31 16:46:03 +06:00
Niklas Eiling
4c0c0319a5 c/r: support for the criu pageserver
this enables lxc to perform "disk-less migrations" where memory pages are sent directly to the destination machine instead of being written to the sources filesystem first.
For this, the migrate_opts struct has been added the strings "pageserver_address" and "pageserver_port" so that criu can be told where to look for a pageserver.

Signed-off-by: Niklas Eiling <niklas.eiling@rwth-aachen.de>
2016-03-31 12:14:50 +02:00
Serge Hallyn
a495e1fd3f Merge pull request #932 from n-eiling/criu-log-fix
fix possible buffer overflow
2016-03-30 18:44:36 -05:00
Niklas Eiling
72a30576da use snprintf instead of strncat
Signed-off-by: Niklas Eiling <niklas.eiling@rwth-aachen.de>
2016-03-30 23:34:37 +02:00
Stéphane Graber
24d6495f0d Merge pull request #933 from evgeni/update-debian-releases
update Debian release names
2016-03-30 16:53:28 -04:00
Evgeni Golov
808652d147 update Debian release names
Squeeze is EOL now, Stretch is the upcoming stable

Signed-off-by: Evgeni Golov <evgeni@golov.de>
2016-03-30 22:51:13 +02:00
Niklas Eiling
a17fa3c081 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>
2016-03-30 20:10:21 +02:00
Serge Hallyn
cb82ed3928 Merge pull request #929 from brauner/2016-03-27/mmap_file_to_str
use smarter error handling for lxc_strmmap()
2016-03-30 11:19:44 -05:00
Christian Brauner
981f6029c3 use common lxc ordering for included headers
Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
2016-03-30 18:07:38 +02:00
Serge Hallyn
42071d376b Merge pull request #930 from brauner/2016-03-30/ignore_all_so
also ingore *.so.*
2016-03-30 11:06:02 -05:00
Christian Brauner
a1e5280d9e 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>
2016-03-30 10:20:43 +02:00
Christian Brauner
1000e4cb5b also ingore *.so.*
Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
2016-03-30 10:19:17 +02:00
Christian Brauner
98139b9f50 Merge pull request #928 from stgraber/master
lxc-ubuntu: Fix building on secondary architectures
2016-03-30 07:49:55 +02:00
Stéphane Graber
aec6a20578
lxc-ubuntu: Fix building on secondary architectures
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-03-30 01:25:53 -04:00
Stéphane Graber
fc12923999
change version to 2.0.0.rc14 in configure.ac
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-03-29 21:31:14 -04:00
Serge Hallyn
03faa62170 Merge pull request #926 from brauner/2016-03-27/mmap_file_to_str
add funs to mmap() files to \0-terminated strings
2016-03-29 11:11:37 -05:00
Christian Brauner
25086a5fe4 better naming for mmap helpers
Rename lxc_mmap()/lxc_munmap() to lxc_strmmap()/lxc_strmunmap().

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
2016-03-29 08:50:27 +02:00
Christian Brauner
aeea34d709 use lxc_mmap() and lxc_munmap()
Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
2016-03-29 08:48:27 +02:00
Christian Brauner
1adbd02064 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>
2016-03-29 08:48:27 +02:00
Stéphane Graber
bc41134fc6 Merge pull request #927 from tych0/only-use-host-devnull-no-autodev
start: only use host's /dev/null when absolutely necessary
2016-03-29 01:25:51 -04:00
Tycho Andersen
7a55c1576e 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>
2016-03-28 18:43:20 -06:00
Stéphane Graber
8f1de71ba5 Merge pull request #924 from evgeni/default-ubuntu-mirror
always provide a default mirror for debootstraping Ubuntu
2016-03-26 13:05:51 -04:00
Stéphane Graber
dc801c70a1 Merge pull request #925 from evgeni/debian-main-only
only enable Debian's main repository by default
2016-03-26 13:04:58 -04:00
Evgeni Golov
57b40c0852 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>
2016-03-26 11:28:52 +01:00