c/r: only supply --ext-mount-map for bind mounts

The rest of the mounts can be restored normally.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
This commit is contained in:
Tycho Andersen 2017-02-15 11:28:24 -07:00
parent c5bce6ee3c
commit 19d2422b99

View 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";