Commit ff3471f7 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

fowners: Prepare ground for dump and restore

Just show implemented and stubs added to image
(regular file and pipes).
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent d29f3bc0
......@@ -93,6 +93,12 @@ out:
pr_img_tail(CR_FD_FDINFO);
}
static void show_fown_cont(fown_t *fown)
{
pr_msg("fown: uid: %x euid: %x signum: %x pid_type: %x pid: %u",
fown->uid, fown->euid, fown->signum, fown->pid_type, fown->pid);
}
void show_reg_files(int fd_reg_files, struct cr_options *o)
{
struct reg_file_entry rfe;
......@@ -106,7 +112,8 @@ void show_reg_files(int fd_reg_files, struct cr_options *o)
if (ret <= 0)
goto out;
pr_msg("id: %8x flags: %4x pos: %lx", rfe.id, rfe.flags, rfe.pos);
pr_msg("id: %8x flags: %4x pos: %lx ", rfe.id, rfe.flags, rfe.pos);
show_fown_cont(&rfe.fown);
if (rfe.len) {
int ret = read(fd_reg_files, local_buf, rfe.len);
......@@ -162,8 +169,10 @@ void show_pipes(int fd_pipes, struct cr_options *o)
ret = read_img_eof(fd_pipes, &e);
if (ret <= 0)
goto out;
pr_msg("id: %8x pipeid: %8x flags: %8x\n",
pr_msg("id: %8x pipeid: %8x flags: %8x ",
e.id, e.pipe_id, e.flags);
show_fown_cont(&e.fown);
pr_msg("\n");
}
out:
......
......@@ -47,11 +47,20 @@ enum fd_types {
#define PAGE_RSS 1
#define PAGE_ANON 2
typedef struct {
u32 uid;
u32 euid;
u32 signum;
u32 pid_type;
u32 pid;
} __packed fown_t;
struct reg_file_entry {
u32 id;
u16 flags;
u16 len;
u64 pos;
fown_t fown;
u8 name[0];
} __packed;
......@@ -79,6 +88,7 @@ struct pipe_entry {
u32 id;
u32 pipe_id;
u32 flags;
fown_t fown;
} __packed;
struct pipe_data_entry {
......
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