]> git.proxmox.com Git - mirror_lxc.git/blobdiff - src/lxc/criu.c
Merge pull request #1539 from brauner/2017-05-06/fix_abstract_unix_sockets
[mirror_lxc.git] / src / lxc / criu.c
index 50a74000d8bf8f0d81faf0cf996aa096a8eaf39c..9b0ccacb6af7a136603a3d4e569dd223e9e74e91 100644 (file)
@@ -21,7 +21,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #define _GNU_SOURCE
-#include <assert.h>
 #include <inttypes.h>
 #include <linux/limits.h>
 #include <sched.h>
@@ -330,13 +329,23 @@ static void exec_criu(struct criu_opts *opts)
                DECLARE_ARG(opts->user->action_script);
        }
 
-       mnts = write_mount_file(&opts->c->lxc_conf->mount_list);
+       mnts = make_anonymous_mount_file(&opts->c->lxc_conf->mount_list);
        if (!mnts)
                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";