[CRIU] Re: [PATCH 1/4] IPC: dump semaphores set

Pavel Emelyanov xemul at parallels.com
Fri Feb 10 03:37:34 EST 2012


On 02/09/2012 07:57 PM, Kinsbursky Stanislav wrote:
> 
> 
> Signed-off-by: Stanislav Kinsbursky <skinsbursky at parallels.com>
> 
> ---
>  crtools.c         |    6 +++
>  include/crtools.h |    3 +
>  include/image.h   |    7 +++
>  ipc_ns.c          |  114 +++++++++++++++++++++++++++++++++++++++++++++--------
>  4 files changed, 112 insertions(+), 18 deletions(-)
> 
> diff --git a/crtools.c b/crtools.c
> index fee18ef..3c6380c 100644
> --- a/crtools.c
> +++ b/crtools.c
> @@ -128,6 +128,12 @@ struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX] = {
>  		.fmt	= FMT_FNAME_IPCNS_MSG,
>  		.magic	= IPCNS_MSG_MAGIC,
>  	},
> +
> +	/* IPC namespace message queues */

Message queues?!

> +	[CR_FD_IPCNS_SEM] = {
> +		.fmt	= FMT_FNAME_IPCNS_SEM,
> +		.magic	= IPCNS_SEM_MAGIC,
> +	},
>  };
>  
>  static struct cr_fdset *alloc_cr_fdset(void)
> +static int dump_ipc_sem_seg(int fd, int id, const struct semid_ds *ds)

ipc_sem_seg? seg? segment? Why segment, it's not a memory region or whatever.

> +{
> +	struct ipc_sem_entry sem;
> +	int ret;
> +
> +	fill_ipc_seg(id, &sem.seg, &ds->sem_perm);
> +	sem.nsems = ds->sem_nsems;
> +	print_ipc_sem_entry(&sem);
> +
> +	ret = write_img(fd, &sem);
> +	if (ret < 0) {
> +		pr_err("Failed to write IPC semaphores set\n");
> +		return ret;
> +	}
> +	return dump_ipc_sem_set(fd, &sem);
> +}


More information about the CRIU mailing list