Commit 725e2d00 authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Pavel Emelyanov

mount: Collect new type binfmt_misc.img image entries

v6: New
Signed-off-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 6eaedfaa
...@@ -136,6 +136,9 @@ static int crtools_prepare_shared(void) ...@@ -136,6 +136,9 @@ static int crtools_prepare_shared(void)
if (collect_inet_sockets()) if (collect_inet_sockets())
return -1; return -1;
if (collect_binfmt_misc())
return -1;
if (tty_prep_fds()) if (tty_prep_fds())
return -1; return -1;
......
...@@ -90,6 +90,7 @@ struct mount_info { ...@@ -90,6 +90,7 @@ struct mount_info {
extern struct mount_info *mntinfo; extern struct mount_info *mntinfo;
extern struct ns_desc mnt_ns_desc; extern struct ns_desc mnt_ns_desc;
extern int collect_binfmt_misc(void);
extern struct mount_info *mnt_entry_alloc(); extern struct mount_info *mnt_entry_alloc();
extern void mnt_entry_free(struct mount_info *mi); extern void mnt_entry_free(struct mount_info *mi);
......
...@@ -40,6 +40,12 @@ ...@@ -40,6 +40,12 @@
#undef LOG_PREFIX #undef LOG_PREFIX
#define LOG_PREFIX "mnt: " #define LOG_PREFIX "mnt: "
struct binfmt_misc_info {
BinfmtMiscEntry *bme;
struct list_head list;
};
static LIST_HEAD(binfmt_misc_list);
static struct fstype fstypes[]; static struct fstype fstypes[];
int ext_mount_add(char *key, char *val) int ext_mount_add(char *key, char *val)
...@@ -1537,6 +1543,29 @@ free_buf: ...@@ -1537,6 +1543,29 @@ free_buf:
return ret; return ret;
} }
static int collect_one_binfmt_misc_entry(void *o, ProtobufCMessage *msg, struct cr_img *img)
{
struct binfmt_misc_info *bmi = o;
bmi->bme = pb_msg(msg, BinfmtMiscEntry);
list_add_tail(&bmi->list, &binfmt_misc_list);
return 0;
}
struct collect_image_info binfmt_misc_cinfo = {
.fd_type = CR_FD_BINFMT_MISC,
.pb_type = PB_BINFMT_MISC,
.priv_size = sizeof(struct binfmt_misc_info),
.collect = collect_one_binfmt_misc_entry,
};
int collect_binfmt_misc(void)
{
return collect_image(&binfmt_misc_cinfo);
}
static int fusectl_dump(struct mount_info *pm) static int fusectl_dump(struct mount_info *pm)
{ {
int fd, ret = -1; int fd, ret = -1;
......
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