]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
c/r: only supply --ext-mount-map for bind mounts 1441/head
authorTycho Andersen <tycho.andersen@canonical.com>
Wed, 15 Feb 2017 18:28:24 +0000 (11:28 -0700)
committerTycho Andersen <tycho.andersen@canonical.com>
Wed, 15 Feb 2017 18:28:24 +0000 (11:28 -0700)
The rest of the mounts can be restored normally.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
src/lxc/criu.c

index 53c368b2a34a85cff97e5cfabe7fb141c335a10f..9b0ccacb6af7a136603a3d4e569dd223e9e74e91 100644 (file)
@@ -334,8 +334,18 @@ static void exec_criu(struct criu_opts *opts)
                goto err;
 
        while (getmntent_r(mnts, &mntent, buf, sizeof(buf))) {
-               char *fmt, *key, *val;
+               char *fmt, *key, *val, *mntdata;
                char arg[2 * PATH_MAX + 2];
+               unsigned long flags;
+
+               if (parse_mntopts(mntent.mnt_opts, &flags, &mntdata) < 0)
+                       goto err;
+
+               free(mntdata);
+
+               /* only add --ext-mount-map for actual bind mounts */
+               if (!(flags & MS_BIND))
+                       continue;
 
                if (strcmp(opts->action, "dump") == 0) {
                        fmt = "/%s:%s";