2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

ns: Support UTS namespace

Only two fields are modifiable -- hostname and domainname. So
read them on dump and write on restore.

File format is simple --

u32 magic
u32 length of nodename
u8[] nodename string
u32 length of domainname
u8[] domainname string

For OpenVZ we can write the release at the end, but this is later.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
Pavel Emelyanov
2012-01-26 15:28:00 +04:00
committed by Cyrill Gorcunov
parent 3391416a1b
commit 98f4c2e4de
8 changed files with 173 additions and 2 deletions

View File

@@ -35,6 +35,7 @@ enum {
*/
CR_FD_PSTREE,
CR_FD_UTSNS,
CR_FD_MAX
};
@@ -75,6 +76,7 @@ extern struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX];
#define FMT_FNAME_UNIXSK "unixsk-%d.img"
#define FMT_FNAME_INETSK "inetsk-%d.img"
#define FMT_FNAME_ITIMERS "itimers-%d.img"
#define FMT_FNAME_UTSNS "utsns-%d.img"
extern int get_image_path(char *path, int size, const char *fmt, int pid);
@@ -103,6 +105,8 @@ struct cr_fdset {
CR_FD_DESC_USE(CR_FD_UNIXSK) |\
CR_FD_DESC_USE(CR_FD_INETSK) |\
CR_FD_DESC_USE(CR_FD_ITIMERS) )
#define CR_FD_DESC_NS (\
CR_FD_DESC_USE(CR_FD_UTSNS) )
#define CR_FD_DESC_NONE (0)
int cr_dump_tasks(pid_t pid, struct cr_options *opts);