mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 17:14:28 +00:00
This is for two reasons. First, validation can meet external mount and will call plugins, which is not correct on pre-dump and actually crashes on uninitilized plugins lists. Second, even if on pre-dump mount tree is not "supported" this can be a temporary situation (yes, yes, unlikely, but still). On the other hand, it's better to fail earlier, but that's another story. Reported-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Acked-by: Andrew Vagin <avagin@parallels.com>
66 lines
1.8 KiB
C
66 lines
1.8 KiB
C
#ifndef __CR_NS_H__
|
|
#define __CR_NS_H__
|
|
|
|
#include "files.h"
|
|
|
|
struct ns_desc {
|
|
unsigned int cflag;
|
|
char *str;
|
|
size_t len;
|
|
};
|
|
|
|
struct ns_id {
|
|
unsigned int kid;
|
|
unsigned int id;
|
|
pid_t pid;
|
|
struct ns_desc *nd;
|
|
struct ns_id *next;
|
|
futex_t created; /* boolean */
|
|
union {
|
|
struct {
|
|
struct mount_info *mntinfo_list;
|
|
struct mount_info *mntinfo_tree;
|
|
} mnt;
|
|
|
|
struct {
|
|
int nlsk; /* for sockets collection */
|
|
int seqsk; /* to talk to parasite daemons */
|
|
} net;
|
|
};
|
|
};
|
|
extern struct ns_id *ns_ids;
|
|
|
|
#define NS_DESC_ENTRY(_cflag, _str) \
|
|
{ \
|
|
.cflag = _cflag, \
|
|
.str = _str, \
|
|
.len = sizeof(_str) - 1, \
|
|
}
|
|
|
|
extern bool check_ns_proc(struct fd_link *link);
|
|
|
|
extern struct ns_desc pid_ns_desc;
|
|
extern struct ns_desc user_ns_desc;
|
|
extern unsigned long root_ns_mask;
|
|
|
|
extern const struct fdtype_ops nsfile_dump_ops;
|
|
extern struct collect_image_info nsfile_cinfo;
|
|
|
|
extern int walk_namespaces(struct ns_desc *nd, int (*cb)(struct ns_id *, void *), void *oarg);
|
|
extern int collect_namespaces(bool for_dump);
|
|
extern int collect_mnt_namespaces(bool for_dump);
|
|
extern int dump_mnt_namespaces(void);
|
|
extern int dump_namespaces(struct pstree_item *item, unsigned int ns_flags);
|
|
extern int prepare_namespace(struct pstree_item *item, unsigned long clone_flags);
|
|
extern int try_show_namespaces(int pid);
|
|
|
|
extern int switch_ns(int pid, struct ns_desc *nd, int *rst);
|
|
extern int restore_ns(int rst, struct ns_desc *nd);
|
|
|
|
extern int dump_task_ns_ids(struct pstree_item *);
|
|
extern int predump_task_ns_ids(struct pstree_item *);
|
|
extern struct ns_id *rst_new_ns_id(unsigned int id, pid_t pid, struct ns_desc *nd);
|
|
extern int rst_add_ns_id(unsigned int id, pid_t pid, struct ns_desc *nd);
|
|
extern struct ns_id *lookup_ns_by_id(unsigned int id, struct ns_desc *nd);
|
|
|
|
#endif /* __CR_NS_H__ */
|