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>
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>.
<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>
<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>
<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>
<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>
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>
noinst_HEADERS = \
attach.h \
storage/storage.h \
- storage/aufs.h \
storage/btrfs.h \
storage/dir.h \
storage/loop.h \
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 \
#include "parse.h"
#include "ringbuf.h"
#include "storage.h"
-#include "storage/aufs.h"
#include "storage/overlay.h"
#include "terminal.h"
#include "utils.h"
const char *lxc_name,
const char *lxc_path)
{
- int ret = 0;
+ int fd, ret;
+ char *p1, *p2;
- if (!strncmp(mntent->mnt_type, "overlay", 7))
+ if (strncmp(mntent->mnt_type, "overlay", 7) == 0) {
ret = ovl_mkdir(mntent, rootfs, lxc_name, lxc_path);
- else if (!strncmp(mntent->mnt_type, "aufs", 4))
- ret = aufs_mkdir(mntent, rootfs, lxc_name, lxc_path);
- if (ret < 0)
- return -1;
+ if (ret < 0)
+ return -1;
+ }
if (hasmntopt(mntent, "create=dir")) {
ret = mkdir_p(path, 0755);
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))
-s [ implies overlay]
-s -B overlay
--s -B aufs
only rootfs gets converted (copied/snapshotted) on clone.
*/
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;
}
+++ /dev/null
-/*
- * 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
- */
-
-#define _GNU_SOURCE
-#include <errno.h>
-#include <stdint.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#include "aufs.h"
-#include "log.h"
-#include "rsync.h"
-#include "storage.h"
-#include "utils.h"
-
-lxc_log_define(aufs, lxc);
-
-/* the bulk of this needs to become a common helper */
-extern char *dir_new_path(char *src, const char *oldname, const char *name,
- const char *oldpath, const char *lxcpath);
-
-int lxc_rsync_delta(struct rsync_data_char *data)
-{
- int ret;
-
- ret = lxc_switch_uid_gid(0, 0);
- if (ret < 0)
- return -1;
-
- ret = lxc_setgroups(0, NULL);
- if (ret < 0)
- return -1;
-
- ret = lxc_rsync_exec(data->src, data->dest);
- if (ret < 0) {
- ERROR("Failed to rsync from \"%s\" into \"%s\"", data->src,
- data->dest);
- return -1;
- }
-
- return 0;
-}
-
-int lxc_rsync_delta_wrapper(void *data)
-{
- struct rsync_data_char *arg = data;
- return lxc_rsync_delta(arg);
-}
-
-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)
-{
- char cmd_output[MAXPATHLEN];
-
- if (!snap) {
- ERROR("aufs is only for snapshot clones");
- return -22;
- }
-
- if (!orig->src || !orig->dest)
- return -1;
-
- new->dest = dir_new_path(orig->dest, oldname, cname, oldpath, lxcpath);
- if (!new->dest)
- return -1;
- if (mkdir_p(new->dest, 0755) < 0)
- return -1;
-
- if (am_guest_unpriv() && chown_mapped_root(new->dest, conf) < 0)
- WARN("Failed to update ownership of %s", new->dest);
-
- if (strcmp(orig->type, "dir") == 0) {
- char *delta, *lastslash;
- int ret, len, lastslashidx;
-
- // if we have /var/lib/lxc/c2/rootfs, then delta will be
- // /var/lib/lxc/c2/delta0
- lastslash = strrchr(new->dest, '/');
- if (!lastslash)
- return -22;
- if (strlen(lastslash) < 7)
- return -22;
- lastslash++;
- lastslashidx = lastslash - new->dest;
-
- delta = malloc(lastslashidx + 7);
- if (!delta)
- return -1;
- strncpy(delta, new->dest, lastslashidx+1);
- strcpy(delta+lastslashidx, "delta0");
- if ((ret = mkdir(delta, 0755)) < 0) {
- SYSERROR("error: mkdir %s", delta);
- free(delta);
- return -1;
- }
- if (am_guest_unpriv() && chown_mapped_root(delta, conf) < 0)
- WARN("Failed to update ownership of %s", delta);
-
- // the src will be 'aufs:lowerdir:upperdir'
- len = strlen(delta) + strlen(orig->src) + 12;
- new->src = malloc(len);
- if (!new->src) {
- free(delta);
- return -ENOMEM;
- }
- ret = snprintf(new->src, len, "aufs:%s:%s", orig->src, delta);
- free(delta);
- if (ret < 0 || ret >= len)
- return -ENOMEM;
- } else if (strcmp(orig->type, "aufs") == 0) {
- // What exactly do we want to do here?
- // I think we want to use the original lowerdir, with a
- // private delta which is originally rsynced from the
- // original delta
- char *osrc, *odelta, *nsrc, *ndelta;
- int len, ret;
- if (!(osrc = strdup(orig->src)))
- return -22;
- nsrc = strchr(osrc, ':') + 1;
- if (nsrc != osrc + 5 || (odelta = strchr(nsrc, ':')) == NULL) {
- free(osrc);
- return -22;
- }
- *odelta = '\0';
- odelta++;
- ndelta = dir_new_path(odelta, oldname, cname, oldpath, lxcpath);
- if (!ndelta) {
- free(osrc);
- return -ENOMEM;
- }
- if ((ret = mkdir(ndelta, 0755)) < 0 && errno != EEXIST) {
- SYSERROR("error: mkdir %s", ndelta);
- free(osrc);
- free(ndelta);
- return -1;
- }
- if (am_guest_unpriv() && chown_mapped_root(ndelta, conf) < 0)
- WARN("Failed to update ownership of %s", ndelta);
-
- struct rsync_data_char rdata;
- rdata.src = odelta;
- rdata.dest = ndelta;
- if (am_guest_unpriv())
- ret = userns_exec_full(conf, lxc_rsync_delta_wrapper,
- &rdata, "lxc_rsync_delta_wrapper");
- else
- ret = run_command(cmd_output, sizeof(cmd_output),
- lxc_rsync_delta_wrapper,
- (void *)&rdata);
- if (ret) {
- free(osrc);
- free(ndelta);
- ERROR("copying aufs delta");
- return -1;
- }
- len = strlen(nsrc) + strlen(ndelta) + 12;
- new->src = malloc(len);
- if (!new->src) {
- free(osrc);
- free(ndelta);
- return -ENOMEM;
- }
- ret = snprintf(new->src, len, "aufs:%s:%s", nsrc, ndelta);
- free(osrc);
- free(ndelta);
- if (ret < 0 || ret >= len)
- return -ENOMEM;
- } else {
- ERROR("aufs clone of %s container is not yet supported",
- orig->type);
- // Note, supporting this will require aufs_mount supporting
- // mounting of the underlay. No big deal, just needs to be done.
- return -1;
- }
-
- return 0;
-}
-
-/*
- * to say 'lxc-create -t ubuntu -n o1 -B aufs' means you want
- * $lxcpath/$lxcname/rootfs to have the created container, while all
- * changes after starting the container are written to
- * $lxcpath/$lxcname/delta0
- */
-int aufs_create(struct lxc_storage *bdev, const char *dest, const char *n,
- struct bdev_specs *specs)
-{
- char *delta;
- int ret, len = strlen(dest), newlen;
-
- if (len < 8 || strcmp(dest+len-7, "/rootfs") != 0)
- return -1;
-
- if (!(bdev->dest = strdup(dest))) {
- ERROR("Out of memory");
- return -1;
- }
-
- delta = alloca(strlen(dest)+1);
- strcpy(delta, dest);
- strcpy(delta+len-6, "delta0");
-
- if (mkdir_p(delta, 0755) < 0) {
- ERROR("Error creating %s", delta);
- return -1;
- }
-
- /* aufs:lower:upper */
- newlen = (2 * len) + strlen("aufs:") + 2;
- bdev->src = malloc(newlen);
- if (!bdev->src) {
- ERROR("Out of memory");
- return -1;
- }
- ret = snprintf(bdev->src, newlen, "aufs:%s:%s", dest, delta);
- if (ret < 0 || ret >= newlen)
- return -1;
-
- if (mkdir_p(bdev->dest, 0755) < 0) {
- ERROR("Error creating %s", bdev->dest);
- return -1;
- }
-
- return 0;
-}
-
-int aufs_destroy(struct lxc_storage *orig)
-{
- char *upper;
-
- if (strncmp(orig->src, "aufs:", 5) != 0)
- return -22;
- upper = strchr(orig->src + 5, ':');
- if (!upper)
- return -22;
- upper++;
- return lxc_rmdir_onedev(upper, NULL);
-}
-
-bool aufs_detect(const char *path)
-{
- if (!strncmp(path, "aufs:", 5))
- return true;
-
- return false;
-}
-
-int aufs_mount(struct lxc_storage *bdev)
-{
- char *tmp, *options, *dup, *lower, *upper;
- int len;
- unsigned long mntflags;
- char *mntdata;
- int ret;
- const char *xinopath = "/dev/shm/aufs.xino";
-
- if (strcmp(bdev->type, "aufs"))
- return -22;
- if (!bdev->src || !bdev->dest)
- return -22;
-
- // separately mount it first
- // mount -t aufs -obr=${upper}=rw:${lower}=ro lower dest
- dup = alloca(strlen(bdev->src)+1);
- strcpy(dup, bdev->src);
- /* support multiple lower layers */
- if (!(lower = strstr(dup, ":/")))
- return -22;
- lower++;
- upper = lower;
- while ((tmp = strstr(++upper, ":/"))) {
- upper = tmp;
- }
- if (--upper == lower)
- return -22;
- *upper = '\0';
- upper++;
-
- if (parse_mntopts(bdev->mntopts, &mntflags, &mntdata) < 0) {
- free(mntdata);
- return -22;
- }
-
- // TODO We should check whether bdev->src is a blockdev, and if so
- // but for now, only support aufs of a basic directory
-
- // AUFS does not work on top of certain filesystems like (XFS or Btrfs)
- // so add xino=/dev/shm/aufs.xino parameter to mount options.
- // The same xino option can be specified to multiple aufs mounts, and
- // a xino file is not shared among multiple aufs mounts.
- //
- // see http://www.mail-archive.com/aufs-users@lists.sourceforge.net/msg02587.html
- // http://www.mail-archive.com/aufs-users@lists.sourceforge.net/msg05126.html
- if (mntdata) {
- len = strlen(lower) + strlen(upper) + strlen(xinopath) + strlen("br==rw:=ro,,xino=") + strlen(mntdata) + 1;
- options = alloca(len);
- ret = snprintf(options, len, "br=%s=rw:%s=ro,%s,xino=%s", upper, lower, mntdata, xinopath);
- }
- else {
- len = strlen(lower) + strlen(upper) + strlen(xinopath) + strlen("br==rw:=ro,xino=") + 1;
- options = alloca(len);
- ret = snprintf(options, len, "br=%s=rw:%s=ro,xino=%s", upper, lower, xinopath);
- }
-
- if (ret < 0 || ret >= len) {
- free(mntdata);
- return -1;
- }
-
- ret = mount(lower, bdev->dest, "aufs", MS_MGC_VAL | mntflags, options);
- if (ret < 0)
- SYSERROR("aufs: error mounting %s onto %s options %s",
- lower, bdev->dest, options);
- else
- INFO("aufs: mounted %s onto %s options %s",
- lower, bdev->dest, options);
- return ret;
-}
-
-int aufs_umount(struct lxc_storage *bdev)
-{
- if (strcmp(bdev->type, "aufs"))
- return -22;
- if (!bdev->src || !bdev->dest)
- return -22;
- return umount(bdev->dest);
-}
-
-char *aufs_get_rootfs(const char *rootfs_path, size_t *rootfslen)
-{
- char *rootfsdir = NULL;
- char *s1 = NULL;
- char *s2 = NULL;
- char *s3 = NULL;
-
- if (!rootfs_path || !rootfslen)
- return NULL;
-
- s1 = strdup(rootfs_path);
- if (!s1)
- return NULL;
-
- if ((s2 = strstr(s1, ":/"))) {
- s2 = s2 + 1;
- if ((s3 = strstr(s2, ":/")))
- *s3 = '\0';
- rootfsdir = strdup(s2);
- if (!rootfsdir) {
- free(s1);
- return NULL;
- }
- }
-
- if (!rootfsdir)
- rootfsdir = s1;
- else
- free(s1);
-
- *rootfslen = strlen(rootfsdir);
-
- return rootfsdir;
-}
-
-int aufs_mkdir(const struct mntent *mntent, const struct lxc_rootfs *rootfs,
- const char *lxc_name, const char *lxc_path)
-{
- char lxcpath[MAXPATHLEN];
- char *rootfs_path = NULL;
- char *rootfsdir = NULL;
- char *scratch = NULL;
- char *tmp = NULL;
- char *upperdir = NULL;
- char **opts = NULL;
- int fret = -1;
- int ret = 0;
- size_t arrlen = 0;
- size_t i;
- size_t len = 0;
- size_t rootfslen = 0;
-
- /* When rootfs == NULL we have a container without a rootfs. */
- if (rootfs && rootfs->path)
- rootfs_path = rootfs->path;
-
- opts = lxc_string_split(mntent->mnt_opts, ',');
- if (opts)
- arrlen = lxc_array_len((void **)opts);
- else
- goto err;
-
- for (i = 0; i < arrlen; i++) {
- if (strstr(opts[i], "br=") && (strlen(opts[i]) > (len = strlen("br="))))
- tmp = opts[i] + len;
- }
- if (!tmp)
- goto err;
-
- upperdir = strtok_r(tmp, ":=", &scratch);
- if (!upperdir)
- goto err;
-
- if (rootfs_path) {
- ret = snprintf(lxcpath, MAXPATHLEN, "%s/%s", lxc_path, lxc_name);
- if (ret < 0 || ret >= MAXPATHLEN)
- goto err;
-
- rootfsdir = aufs_get_rootfs(rootfs->path, &rootfslen);
- if (!rootfsdir)
- goto err;
- }
-
- /*
- * We neither allow users to create upperdirs and workdirs outside the
- * containerdir nor inside the rootfs. The latter might be debatable.
- * When we have a container without a rootfs we skip the checks.
- */
- ret = 0;
- if (!rootfs_path)
- ret = mkdir_p(upperdir, 0755);
- else if ((strncmp(upperdir, lxcpath, strlen(lxcpath)) == 0) && (strncmp(upperdir, rootfsdir, rootfslen) != 0))
- ret = mkdir_p(upperdir, 0755);
- if (ret < 0)
- WARN("Failed to create upperdir");
-
- fret = 0;
-
-err:
- free(rootfsdir);
- lxc_free_array((void **)opts, free);
- return fret;
-}
-
+++ /dev/null
-/*
- * 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 */
if (strstr(mnt_entry, "overlay"))
tmp = "upperdir";
- else if (strstr(mnt_entry, "aufs"))
- tmp = "br";
-
if (!tmp)
continue;
#include <sys/stat.h>
#include <sys/wait.h>
-#include "aufs.h"
#include "btrfs.h"
#include "conf.h"
#include "config.h"
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,
{ .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, },
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;
}
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;
}
* 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 ||
* 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 ||
{
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 ||
enum mnttype {
LXC_MNT_BIND,
- LXC_MNT_AUFS,
LXC_MNT_OVL,
};
/* mount keys */
static char *const keys[] = {
[LXC_MNT_BIND] = "bind",
- [LXC_MNT_AUFS] = "aufs",
[LXC_MNT_OVL] = "overlay",
NULL
};
.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\
-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\
/* 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);
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)
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;
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;
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;
}
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
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;
}
{
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 ||