Commit fbeb3acc authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Pavel Emelyanov

mount: Autodetect binfmt_misc

Set opts bit if binfmt_misc is mounted on root mnt_ns

v5: New
Signed-off-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent ee15a000
...@@ -103,6 +103,7 @@ struct cr_options { ...@@ -103,6 +103,7 @@ struct cr_options {
bool enable_external_masters; bool enable_external_masters;
bool aufs; /* auto-deteced, not via cli */ bool aufs; /* auto-deteced, not via cli */
bool overlayfs; bool overlayfs;
bool has_binfmt_misc; /* auto-detected */
size_t ghost_limit; size_t ghost_limit;
struct list_head irmap_scan_paths; struct list_head irmap_scan_paths;
bool lsm_supplied; bool lsm_supplied;
......
...@@ -1281,6 +1281,14 @@ static int devtmpfs_restore(struct mount_info *pm) ...@@ -1281,6 +1281,14 @@ static int devtmpfs_restore(struct mount_info *pm)
return ret; return ret;
} }
static int binfmt_misc_parse(struct mount_info *pm)
{
if (pm->nsid->type == NS_ROOT)
opts.has_binfmt_misc = true;
return 0;
}
static int binfmt_misc_virtual(struct mount_info *pm) static int binfmt_misc_virtual(struct mount_info *pm)
{ {
return kerndat_fs_virtualized(KERNDAT_FS_STAT_BINFMT_MISC, pm->s_dev); return kerndat_fs_virtualized(KERNDAT_FS_STAT_BINFMT_MISC, pm->s_dev);
...@@ -1718,6 +1726,7 @@ static struct fstype fstypes[] = { ...@@ -1718,6 +1726,7 @@ static struct fstype fstypes[] = {
.restore = devtmpfs_restore, .restore = devtmpfs_restore,
}, { }, {
.name = "binfmt_misc", .name = "binfmt_misc",
.parse = binfmt_misc_parse,
.code = FSTYPE__BINFMT_MISC, .code = FSTYPE__BINFMT_MISC,
.dump = binfmt_misc_dump, .dump = binfmt_misc_dump,
.restore = binfmt_misc_restore, .restore = binfmt_misc_restore,
...@@ -3072,6 +3081,9 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid) ...@@ -3072,6 +3081,9 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
goto err; goto err;
} }
if (me->fstype == FSTYPE__BINFMT_MISC)
opts.has_binfmt_misc = true;
/* FIXME: abort unsupported early */ /* FIXME: abort unsupported early */
pm->fstype = decode_fstype(me->fstype); pm->fstype = decode_fstype(me->fstype);
......
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