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>
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>
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>
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>
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>
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>
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>
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>