Commit e2c38245 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Pavel Emelyanov

introduce --enable-fs cli option

Finally add --enable-fs option to specify the comma separated list of
filesystem names which should be treated as FSTYPE_AUTO.

Note: obviously this option is not safe, use at your own risk. "dump"
will always succeed if the mntpoint is auto, but "restore" can fail or
do something wrong if mount(src, mountpoint, flags, options) can not
actually "just work" as FSTYPE_AUTO logic expects.
Signed-off-by: 's avatarOleg Nesterov <oleg@redhat.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent eaf3a03c
......@@ -204,6 +204,7 @@ int main(int argc, char *argv[], char *envp[])
{ "inherit-fd", required_argument, 0, 1062 },
{ "feature", required_argument, 0, 1063 },
{ "skip-mnt", required_argument, 0, 1064},
{ "enable-fs", required_argument, 0, 1065},
{ },
};
......@@ -421,6 +422,10 @@ int main(int argc, char *argv[], char *envp[])
if (!add_skip_mount(optarg))
return 1;
break;
case 1065:
if (!add_fsname_auto(optarg))
return 1;
break;
case 'M':
{
char *aux;
......@@ -648,6 +653,9 @@ usage:
" installed into. No controller means that root is the\n"
" default for all controllers not specified.\n"
" --skip-mnt PATH ignore this mountpoint when dumping the mount namespace.\n"
" --enable-fs FSNAMES a comma separated list of filesystem names or \"all\".\n"
" force criu to (try to) dump/restore these filesystem's\n"
" mountpoints even if fs is not supported.\n"
"\n"
"* Logging:\n"
" -o|--log-file FILE log file name\n"
......
......@@ -13,6 +13,7 @@ struct proc_mountinfo;
extern int open_mount(unsigned int s_dev);
extern struct fstype *find_fstype_by_name(char *fst);
extern bool add_fsname_auto(const char *names);
struct cr_imgset;
extern struct mount_info * collect_mntinfo(struct ns_id *ns, bool for_dump);
......
......@@ -1172,9 +1172,31 @@ static struct fstype fstypes[32] = {
},
};
static char *fsauto_names;
static bool fsname_is_auto(const char *name)
{
return false;
const char *p;
if (!fsauto_names)
return false;
if (strcmp(fsauto_names, "all") == 0)
return true;
for (p = strtok(fsauto_names, ","); p; p = strtok(NULL, ",")) {
if (strcmp(name, p) == 0)
return true;
}
return false;
}
bool add_fsname_auto(const char *names)
{
xfree(fsauto_names);
fsauto_names = xstrdup(names);
return fsauto_names != NULL;
}
static struct fstype *__find_fstype_by_name(char *_fst, bool force_auto)
......
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