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

dump/restore fstype->name if FSTYPE__AUTO

Add the new mnt_entry->fsname member and change dump_one_mountpoint()
to save pm->fstype->name if fstype == FSTYPE__AUTO.

Change collect_mnt_from_image() to pass this ->fsname to decode_fstype()
which falls back to __find_fstype_by_name(fsname, true) if FSTYPE__AUTO.
Signed-off-by: 's avatarOleg Nesterov <oleg@redhat.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 039cf95d
...@@ -1230,10 +1230,13 @@ struct fstype *find_fstype_by_name(char *fst) ...@@ -1230,10 +1230,13 @@ struct fstype *find_fstype_by_name(char *fst)
return __find_fstype_by_name(fst, false); return __find_fstype_by_name(fst, false);
} }
static struct fstype *decode_fstype(u32 fst) static struct fstype *decode_fstype(u32 fst, char *fsname)
{ {
int i; int i;
if (fst == FSTYPE__AUTO)
return __find_fstype_by_name(fsname, true);
if (fst == FSTYPE__UNSUPPORTED) if (fst == FSTYPE__UNSUPPORTED)
goto uns; goto uns;
...@@ -1259,6 +1262,9 @@ static int dump_one_mountpoint(struct mount_info *pm, struct cr_img *img) ...@@ -1259,6 +1262,9 @@ static int dump_one_mountpoint(struct mount_info *pm, struct cr_img *img)
me.fstype = pm->fstype->code; me.fstype = pm->fstype->code;
if (me.fstype == FSTYPE__AUTO)
me.fsname = pm->fstype->name;
if (pm->parent && !pm->dumped && !pm->need_plugin && if (pm->parent && !pm->dumped && !pm->need_plugin &&
pm->fstype->dump && fsroot_mounted(pm)) { pm->fstype->dump && fsroot_mounted(pm)) {
struct mount_info *t; struct mount_info *t;
...@@ -1981,7 +1987,7 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid) ...@@ -1981,7 +1987,7 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
pm->is_ns_root = is_root(me->mountpoint); pm->is_ns_root = is_root(me->mountpoint);
/* FIXME: abort unsupported early */ /* FIXME: abort unsupported early */
pm->fstype = decode_fstype(me->fstype); pm->fstype = decode_fstype(me->fstype, me->fsname);
if (me->ext_mount) { if (me->ext_mount) {
struct ext_mount *em; struct ext_mount *em;
......
...@@ -37,4 +37,6 @@ message mnt_entry { ...@@ -37,4 +37,6 @@ message mnt_entry {
optional bool with_plugin = 12; optional bool with_plugin = 12;
optional bool ext_mount = 13; optional bool ext_mount = 13;
optional string fsname = 14;
} }
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