[CRIU] Re: [PATCH 2/6] fowners: Prepare ground for dump and restore
Pavel Emelyanov
xemul at parallels.com
Tue Apr 10 05:55:33 EDT 2012
On 04/10/2012 12:03 AM, Cyrill Gorcunov wrote:
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
> cr-show.c | 11 ++++++++++-
> include/image.h | 10 ++++++++++
> 2 files changed, 20 insertions(+), 1 deletions(-)
>
> diff --git a/cr-show.c b/cr-show.c
> index 4616e0e..72ff1e0 100644
> --- a/cr-show.c
> +++ b/cr-show.c
> @@ -96,6 +96,14 @@ out:
> pr_img_tail(CR_FD_FDINFO);
> }
>
> +static void show_fown(fown_t *fown)
> +{
> + if (fown->pid)
> + pr_msg("\tfown: uid: %x euid: %x signum: %x pid_type: %x pid: %x\n",
> + fown->uid, fown->euid,
> + fown->signum, fown->pid_type, fown->pid);
1. One line per entry, i.e. no \n before fowner
2. Even absent fown should be reported, not silently skipped
> +}
> +
> void show_reg_files(int fd_reg_files, struct cr_options *o)
> {
> struct reg_file_entry rfe;
> @@ -120,8 +128,8 @@ void show_reg_files(int fd_reg_files, struct cr_options *o)
> local_buf[rfe.len] = 0;
> pr_msg(" --> %s", local_buf);
> }
> -
> pr_msg("\n");
> + show_fown(&rfe.fown);
> }
>
> out:
> @@ -167,6 +175,7 @@ void show_pipes(int fd_pipes, struct cr_options *o)
> goto out;
> pr_msg("id: %8x pipeid: %8x flags: %8x\n",
> e.id, e.pipe_id, e.flags);
> + show_fown(&e.fown);
> }
>
> out:
> diff --git a/include/image.h b/include/image.h
> index b169eee..b03695b 100644
> --- a/include/image.h
> +++ b/include/image.h
> @@ -48,11 +48,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;
>
> @@ -77,6 +86,7 @@ struct pipe_entry {
> u32 id;
> u32 pipe_id;
> u32 flags;
> + fown_t fown;
> } __packed;
>
> struct pipe_data_entry {
More information about the CRIU
mailing list