mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
mount: Collect new type binfmt_misc.img image entries
v6: New Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
6eaedfaa76
commit
725e2d00b8
@@ -136,6 +136,9 @@ static int crtools_prepare_shared(void)
|
||||
if (collect_inet_sockets())
|
||||
return -1;
|
||||
|
||||
if (collect_binfmt_misc())
|
||||
return -1;
|
||||
|
||||
if (tty_prep_fds())
|
||||
return -1;
|
||||
|
||||
|
@@ -90,6 +90,7 @@ struct mount_info {
|
||||
|
||||
extern struct mount_info *mntinfo;
|
||||
extern struct ns_desc mnt_ns_desc;
|
||||
extern int collect_binfmt_misc(void);
|
||||
|
||||
extern struct mount_info *mnt_entry_alloc();
|
||||
extern void mnt_entry_free(struct mount_info *mi);
|
||||
|
29
criu/mount.c
29
criu/mount.c
@@ -40,6 +40,12 @@
|
||||
#undef LOG_PREFIX
|
||||
#define LOG_PREFIX "mnt: "
|
||||
|
||||
struct binfmt_misc_info {
|
||||
BinfmtMiscEntry *bme;
|
||||
struct list_head list;
|
||||
};
|
||||
|
||||
static LIST_HEAD(binfmt_misc_list);
|
||||
static struct fstype fstypes[];
|
||||
|
||||
int ext_mount_add(char *key, char *val)
|
||||
@@ -1537,6 +1543,29 @@ free_buf:
|
||||
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)
|
||||
{
|
||||
int fd, ret = -1;
|
||||
|
Reference in New Issue
Block a user