Unverified Commit 03a0a42b by Serge Hallyn Committed by GitHub

Merge pull request #2210 from brauner/2018-03-10/conf_cleanups

tree-wide: remove aufs storage driver
parents 0e83121c a8984858
......@@ -113,13 +113,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
root filesystem of the container is simply copied to the new container. Or
they can be snapshots, i.e. small copy-on-write copies of the original
container. In this case the specified backing storage for the copy must
support snapshots. This currently includes aufs, btrfs, lvm (lvm devices
support snapshots. This currently includes btrfs, lvm (lvm devices
do not support snapshots of snapshots.), overlay, and zfs.
</para>
<para>
The copy's backing storage will be of the same type as the original
container. aufs or overlayfs snapshots of directory backed containers are
container. overlay snapshots of directory backed containers are
exempted from this rule.
</para>
......@@ -145,21 +145,22 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Containers created and started with <replaceable>-e</replaceable> can have
custom mounts. These are specified with the <replaceable>-m</replaceable>
flag. Currently three types of mounts are supported:
<replaceable>aufs</replaceable>, <replaceable>bind</replaceable>, and
<replaceable>bind</replaceable>, and
<replaceable>overlay</replaceable>. Mount types are specified as suboptions
to the <replaceable>-m</replaceable> flag and can be specified multiple
times separated by commas. <replaceable>aufs</replaceable> and
<replaceable>overlay</replaceable> mounts are currently specified in the
format <replaceable>-m overlay=/src:/dest</replaceable>. When no
destination <replaceable>dest</replaceable> is specified
times separated by commas. <replaceable>overlay</replaceable> mounts are
currently specified in the format <replaceable>-m
overlay=/src:/dest</replaceable>. When no destination
<replaceable>dest</replaceable> is specified
<replaceable>dest</replaceable> will be identical to
<replaceable>src</replaceable>. Read-only <replaceable>bind</replaceable>
mounts are specified <replaceable>-m bind=/src:/dest:ro</replaceable> and
read-write <replaceable>bind</replaceable> mounts <replaceable>-m
bind=/src:/dest:rw</replaceable>. Read-write <replaceable>bind</replaceable>
mounts are the default and <replaceable>rw</replaceable> can be missing when
a read-write mount is wanted. When <replaceable>dest</replaceable> is
missing <replaceable>dest</replaceable> will be identical to
bind=/src:/dest:rw</replaceable>. Read-write
<replaceable>bind</replaceable> mounts are the default and
<replaceable>rw</replaceable> can be missing when a read-write mount is
wanted. When <replaceable>dest</replaceable> is missing
<replaceable>dest</replaceable> will be identical to
<replaceable>src</replaceable>. An example for multiple mounts would be
<replaceable>-m
bind=/src1:/dest1:ro,bind=/src2:ro,overlay=/src3:/dest3</replaceable>.
......@@ -203,7 +204,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<listitem>
<para> Create a snapshot of the original container. The backing
storage for the copy must support snapshots. This currently includes
aufs, btrfs, lvm, overlay, and zfs. </para>
btrfs, lvm, overlay, and zfs. </para>
</listitem>
</varlistentry>
......@@ -234,7 +235,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<listitem>
<para> Specify a mount for a snapshot The
<replaceable>opts</replaceable> argument for the mount type can by
of type {aufs, bind, overlay}. For example <option>-m
of type {bind, overlay}. For example <option>-m
bind=/src:/dest:ro,overlay=/src:/dest</option> (This option can
currently only be specified in conjunction with
<replaceable>-e</replaceable>.).</para>
......@@ -258,7 +259,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<term> <option>-B, --backingstorage <replaceable>backingstorage</replaceable></option></term>
<listitem>
<para>Specify the backing storage type to be used for the copy
where 'backingstorage' is of type 'aufs', 'btrfs', 'dir', 'lvm', 'loop',
where 'backingstorage' is of type 'btrfs', 'dir', 'lvm', 'loop',
'overlay', or 'zfs'. </para>
</listitem>
</varlistentry>
......
......@@ -129,7 +129,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<varlistentry>
<term> <option>-N, --newname</option> </term>
<listitem>
<para> When restoring a snapshot, the last optional argument if not given explicitly via <command>--newname</command> is the name to use for the restored container. If the newname is identical to the original name of the container, then the original container will be destroyed and the restored container will take its place. Note that deleting the original snapshot is not possible in the case of aufs, overlayfs or zfs backed snapshots.</para>
<para> When restoring a snapshot, the last optional argument if not given explicitly via <command>--newname</command> is the name to use for the restored container. If the newname is identical to the original name of the container, then the original container will be destroyed and the restored container will take its place. Note that deleting the original snapshot is not possible in the case of overlayfs or zfs backed snapshots.</para>
</listitem>
</varlistentry>
......
......@@ -1365,9 +1365,7 @@ dev/null proc/kcore none bind,relative 0 0
itself should be mounted. <filename>overlayfs:/lower:/upper</filename>
specifies that the rootfs should be an overlay with <filename>/upper</filename>
being mounted read-write over a read-only mount of <filename>/lower</filename>.
<filename>aufs:/lower:/upper</filename> does the same using aufs in place
of overlayfs. For both <filename>overlayfs</filename> and
<filename>aufs</filename> multiple <filename>/lower</filename>
For <filename>overlay</filename> multiple <filename>/lower</filename>
directories can be specified. <filename>loop:/file</filename> tells lxc to attach
<filename>/file</filename> to a loop device and mount the loop device.
</para>
......
......@@ -6,7 +6,6 @@ pkginclude_HEADERS = \
noinst_HEADERS = \
attach.h \
storage/storage.h \
storage/aufs.h \
storage/btrfs.h \
storage/dir.h \
storage/loop.h \
......@@ -81,7 +80,6 @@ endif
lib_LTLIBRARIES = liblxc.la
liblxc_la_SOURCES = \
storage/storage.c storage/storage.h \
storage/aufs.c storage/aufs.h \
storage/btrfs.c storage/btrfs.h \
storage/dir.c storage/dir.h \
storage/loop.c storage/loop.h \
......
......@@ -2582,17 +2582,16 @@ bool clone_update_unexp_ovl_paths(struct lxc_conf *conf, const char *oldpath,
if (p >= lend)
goto next;
/* Whenever an lxc.mount.entry entry is found in a line we check
* if the substring " overlay" or the substring " aufs" is
* present before doing any further work. We check for "
* overlay" and " aufs" since both substrings need to have at
* least one space before them in a valid overlay
/* Whenever a lxc.mount.entry entry is found in a line we check
* if the substring "overlay" is present before doing any
* further work. We check for "overlay" because substrings need
* to have at least one space before them in a valid overlay
* lxc.mount.entry (/A B overlay). When the space before is
* missing it is very likely that these substrings are part of a
* path or something else. (Checking q >= lend ensures that we
* only count matches in the current line.) */
if ((!(q = strstr(p, " overlay")) || q >= lend) &&
(!(q = strstr(p, " aufs")) || q >= lend))
q = strstr(p, " overlay");
if (!q || q >= lend)
goto next;
if (!(q = strstr(p, olddir)) || (q >= lend))
......
......@@ -3548,7 +3548,6 @@ sudo lxc-clone -o o1 -n n1 -s -L|-fssize fssize -v|--vgname vgname \
-s [ implies overlay]
-s -B overlay
-s -B aufs
only rootfs gets converted (copied/snapshotted) on clone.
*/
......@@ -3935,7 +3934,7 @@ static int do_lxcapi_snapshot(struct lxc_container *c, const char *commentfile)
if (storage_is_dir(c->lxc_conf)) {
ERROR("Snapshot of directory-backed container requested.");
ERROR("Making a copy-clone. If you do want snapshots, then");
ERROR("please create an aufs or overlay clone first, snapshot that");
ERROR("please create overlay clone first, snapshot that");
ERROR("and keep the original container pristine.");
flags &= ~LXC_CLONE_SNAPSHOT | LXC_CLONE_MAYBE_SNAPSHOT;
}
......
/*
* lxc: linux Container library
*
* (C) Copyright IBM Corp. 2007, 2008
*
* Authors:
* Daniel Lezcano <daniel.lezcano at free.fr>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __LXC_AUFS_H
#define __LXC_AUFS_H
#define _GNU_SOURCE
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include "storage.h"
struct lxc_storage;
struct bdev_specs;
struct lxc_conf;
struct lxc_rootfs;
int aufs_clonepaths(struct lxc_storage *orig, struct lxc_storage *new,
const char *oldname, const char *cname, const char *oldpath,
const char *lxcpath, int snap, uint64_t newsize,
struct lxc_conf *conf);
int aufs_create(struct lxc_storage *bdev, const char *dest, const char *n,
struct bdev_specs *specs);
int aufs_destroy(struct lxc_storage *orig);
bool aufs_detect(const char *path);
int aufs_mount(struct lxc_storage *bdev);
int aufs_umount(struct lxc_storage *bdev);
/* Get rootfs path for aufs backed containers. Allocated memory must be freed by
* caller.
*/
char *aufs_get_rootfs(const char *rootfs_path, size_t *rootfslen);
/*
* Create directories for aufs mounts.
*/
int aufs_mkdir(const struct mntent *mntent, const struct lxc_rootfs *rootfs,
const char *lxc_name, const char *lxc_path);
#endif /* __LXC_AUFS_H */
......@@ -866,9 +866,6 @@ int ovl_update_abs_paths(struct lxc_conf *lxc_conf, const char *lxc_path,
if (strstr(mnt_entry, "overlay"))
tmp = "upperdir";
else if (strstr(mnt_entry, "aufs"))
tmp = "br";
if (!tmp)
continue;
......
......@@ -39,7 +39,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include "aufs.h"
#include "btrfs.h"
#include "conf.h"
#include "config.h"
......@@ -67,20 +66,6 @@
lxc_log_define(storage, lxc);
/* aufs */
static const struct lxc_storage_ops aufs_ops = {
.detect = &aufs_detect,
.mount = &aufs_mount,
.umount = &aufs_umount,
.clone_paths = &aufs_clonepaths,
.destroy = &aufs_destroy,
.create = &aufs_create,
.copy = NULL,
.snapshot = NULL,
.can_snapshot = true,
.can_backup = true,
};
/* btrfs */
static const struct lxc_storage_ops btrfs_ops = {
.detect = &btrfs_detect,
......@@ -204,7 +189,6 @@ static const struct lxc_storage_type bdevs[] = {
{ .name = "lvm", .ops = &lvm_ops, },
{ .name = "rbd", .ops = &rbd_ops, },
{ .name = "btrfs", .ops = &btrfs_ops, },
{ .name = "aufs", .ops = &aufs_ops, },
{ .name = "overlay", .ops = &ovl_ops, },
{ .name = "overlayfs", .ops = &ovl_ops, },
{ .name = "loop", .ops = &loop_ops, },
......@@ -284,11 +268,6 @@ struct lxc_storage *storage_get(const char *type)
bdev->ops = bdevs[i].ops;
bdev->type = bdevs[i].name;
if (strcmp(bdev->type, "aufs") == 0)
WARN("The \"aufs\" driver will is deprecated and will soon be "
"removed. For similar functionality see the \"overlay\" "
"storage driver");
return bdev;
}
......@@ -655,11 +634,6 @@ struct lxc_storage *storage_init(struct lxc_conf *conf)
if (strcmp(bdev->type, "nbd") == 0)
bdev->nbd_idx = conf->nbd_idx;
if (strcmp(bdev->type, "aufs") == 0)
WARN("The \"aufs\" driver will is deprecated and will soon be "
"removed. For similar functionality see the \"overlay\" "
"storage driver");
return bdev;
}
......
......@@ -423,7 +423,6 @@ bool unpriv_snap_allowed(struct lxc_storage *b, const char *t, bool snap,
* allowed).
*/
if (strcmp(b->type, "dir") == 0 ||
strcmp(b->type, "aufs") == 0 ||
strcmp(b->type, "overlay") == 0 ||
strcmp(b->type, "overlayfs") == 0 ||
strcmp(b->type, "btrfs") == 0 ||
......@@ -437,7 +436,6 @@ bool unpriv_snap_allowed(struct lxc_storage *b, const char *t, bool snap,
* In particular, not zfs, btrfs, or lvm.
*/
if (strcmp(t, "dir") == 0 ||
strcmp(t, "aufs") == 0 ||
strcmp(t, "overlay") == 0 ||
strcmp(t, "overlayfs") == 0 ||
strcmp(t, "btrfs") == 0 ||
......@@ -451,7 +449,6 @@ bool is_valid_storage_type(const char *type)
{
if (strcmp(type, "dir") == 0 ||
strcmp(type, "btrfs") == 0 ||
strcmp(type, "aufs") == 0 ||
strcmp(type, "loop") == 0 ||
strcmp(type, "lvm") == 0 ||
strcmp(type, "nbd") == 0 ||
......
......@@ -688,7 +688,7 @@ static int lxc_terminal_peer_default(struct lxc_terminal *terminal)
if (!path) {
errno = ENOTTY;
DEBUG("Theh process does not have a controlling terminal");
DEBUG("The process does not have a controlling terminal");
goto on_succes;
}
......
......@@ -44,7 +44,6 @@
enum mnttype {
LXC_MNT_BIND,
LXC_MNT_AUFS,
LXC_MNT_OVL,
};
......@@ -84,7 +83,6 @@ static const struct option my_longopts[] = {
/* mount keys */
static char *const keys[] = {
[LXC_MNT_BIND] = "bind",
[LXC_MNT_AUFS] = "aufs",
[LXC_MNT_OVL] = "overlay",
NULL
};
......@@ -93,7 +91,7 @@ static struct lxc_arguments my_args = {
.progname = "lxc-copy",
.help = "\n\
--name=NAME [-P lxcpath] -N newname [-p newpath] [-B backingstorage] [-s] [-K] [-M] [-L size [unit]] -- hook options\n\
--name=NAME [-P lxcpath] [-N newname] [-p newpath] [-B backingstorage] -e [-d] [-D] [-K] [-M] [-m {bind,aufs,overlay}=/src:/dest] -- hook options\n\
--name=NAME [-P lxcpath] [-N newname] [-p newpath] [-B backingstorage] -e [-d] [-D] [-K] [-M] [-m {bind,overlay}=/src:/dest] -- hook options\n\
--name=NAME [-P lxcpath] -N newname -R\n\
\n\
lxc-copy clone a container\n\
......@@ -108,7 +106,7 @@ Options :\n\
-d, --daemon daemonize the container (default)\n\
-e, --ephemeral start ephemeral container\n\
-m, --mount directory to mount into container, either \n\
{bind,aufs,overlay}=/src-path or {bind,aufs,overlay}=/src-path:/dst-path\n\
{bind,overlay}=/src-path or {bind,overlay}=/src-path:/dst-path\n\
-B, --backingstorage=TYPE backingstorage type for the container\n\
-t, --tmpfs place ephemeral container on a tmpfs\n\
(WARNING: On reboot all changes made to the container will be lost.)\n\
......@@ -146,13 +144,12 @@ static uint64_t get_fssize(char *s);
/* Place an ephemeral container started with -e flag on a tmpfs. Restrictions
* are that you cannot request the data to be kept while placing the container
* on a tmpfs and that either overlay or aufs backing storage must be used.
* on a tmpfs and that either overlay storage driver must be used.
*/
static char *mount_tmpfs(const char *oldname, const char *newname,
const char *path, struct lxc_arguments *arg);
static int parse_mntsubopts(char *subopts, char *const *keys,
char *mntparameters);
static int parse_aufs_mnt(char *mntstring, enum mnttype type);
static int parse_bind_mnt(char *mntstring, enum mnttype type);
static int parse_ovl_mnt(char *mntstring, enum mnttype type);
......@@ -268,7 +265,7 @@ static int mk_rand_ovl_dirs(struct mnts *mnts, unsigned int num, struct lxc_argu
struct mnts *m = NULL;
for (i = 0, m = mnts; i < num; i++, m++) {
if ((m->mnt_type == LXC_MNT_OVL) || (m->mnt_type == LXC_MNT_AUFS)) {
if (m->mnt_type == LXC_MNT_OVL) {
ret = snprintf(upperdir, TOOL_MAXPATHLEN, "%s/%s/delta#XXXXXX",
arg->newpath, arg->newname);
if (ret < 0 || ret >= TOOL_MAXPATHLEN)
......@@ -317,20 +314,7 @@ static char *set_mnt_entry(struct mnts *m)
int ret = 0;
size_t len = 0;
if (m->mnt_type == LXC_MNT_AUFS) {
len = strlen(" aufs br==rw:=ro,xino=,create=dir") +
2 * strlen(m->src) + strlen(m->dest) + strlen(m->upper) +
strlen(m->workdir) + 1;
mntentry = malloc(len);
if (!mntentry)
goto err;
ret = snprintf(mntentry, len, "%s %s aufs br=%s=rw:%s=ro,xino=%s,create=dir",
m->src, m->dest, m->upper, m->src, m->workdir);
if (ret < 0 || (size_t)ret >= len)
goto err;
} else if (m->mnt_type == LXC_MNT_OVL) {
if (m->mnt_type == LXC_MNT_OVL) {
len = strlen(" overlay lowerdir=,upperdir=,workdir=,create=dir") +
2 * strlen(m->src) + strlen(m->dest) + strlen(m->upper) +
strlen(m->workdir) + 1;
......@@ -631,49 +615,6 @@ static int my_parser(struct lxc_arguments *args, int c, char *arg)
return 0;
}
static int parse_aufs_mnt(char *mntstring, enum mnttype type)
{
int len = 0;
const char *xinopath = "/dev/shm/aufs.xino";
char **mntarray = NULL;
struct mnts *m = NULL;
m = add_mnt(&mnt_table, &mnt_table_size, type);
if (!m)
goto err;
mntarray = lxc_string_split(mntstring, ':');
if (!mntarray)
goto err;
m->src = construct_path(mntarray[0], true);
if (!m->src)
goto err;
len = lxc_array_len((void **)mntarray);
if (len == 1) /* aufs=src */
m->dest = construct_path(mntarray[0], false);
else if (len == 2) /* aufs=src:dest */
m->dest = construct_path(mntarray[1], false);
else
printf("Excess elements in mount specification\n");
if (!m->dest)
goto err;
m->workdir = strdup(xinopath);
if (!m->workdir)
goto err;
lxc_free_array((void **)mntarray, free);
return 0;
err:
free_mnts();
lxc_free_array((void **)mntarray, free);
return -1;
}
static int parse_bind_mnt(char *mntstring, enum mnttype type)
{
int len = 0;
......@@ -744,10 +685,6 @@ static int parse_mntsubopts(char *subopts, char *const *keys, char *mntparameter
if (parse_ovl_mnt(mntparameters, LXC_MNT_OVL) < 0)
return -1;
break;
case LXC_MNT_AUFS:
if (parse_aufs_mnt(mntparameters, LXC_MNT_AUFS) < 0)
return -1;
break;
default:
break;
}
......@@ -793,7 +730,7 @@ err:
return -1;
}
/* For ephemeral snapshots backed by overlay or aufs filesystems, this function
/* For ephemeral snapshots backed by the overlay filesystem, this function
* mounts a fresh tmpfs over the containers directory if the user requests it.
* Because we mount a fresh tmpfs over the directory of the container the
* updated /etc/hostname file created during the clone residing in the upperdir
......@@ -811,18 +748,19 @@ static char *mount_tmpfs(const char *oldname, const char *newname,
FILE *fp;
if (arg->tmpfs && arg->keepdata) {
fprintf(stderr, "%s\n", "A container can only be placed on a "
"tmpfs when storage backend is overlay "
"or aufs.");
fprintf(stderr, "%s\n",
"A container can only be placed on a tmpfs when the "
"overlay storage driver is used");
goto err_free;
}
if (arg->tmpfs && !arg->bdevtype) {
arg->bdevtype = "overlayfs";
} else if (arg->tmpfs && arg->bdevtype && strcmp(arg->bdevtype, "overlayfs") && strcmp(arg->bdevtype, "aufs")) {
fprintf(stderr, "%s\n", "A container can only be placed on a "
"tmpfs when storage backend is overlay "
"or aufs.");
} else if (arg->tmpfs && arg->bdevtype &&
strcmp(arg->bdevtype, "overlayfs") != 0) {
fprintf(stderr, "%s\n",
"A container can only be placed on a tmpfs when the "
"overlay storage driver is used");
goto err_free;
}
......
......@@ -205,7 +205,6 @@ static bool is_valid_storage_type(const char *type)
{
if (strcmp(type, "dir") == 0 ||
strcmp(type, "btrfs") == 0 ||
strcmp(type, "aufs") == 0 ||
strcmp(type, "loop") == 0 ||
strcmp(type, "lvm") == 0 ||
strcmp(type, "nbd") == 0 ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment