[CRIU] Re: [PATCH 1/4] sockets, unix: Use general machnism for checkpoint/restore

Pavel Emelyanov xemul at parallels.com
Fri May 25 02:40:45 EDT 2012


On 05/23/2012 07:35 PM, Cyrill Gorcunov wrote:
> 
> Use fdtype_ops facility to c/r unix sockets.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  include/image.h   |    1 +
>  include/sockets.h |    3 +-
>  sk-unix.c         |  100 +++++++++++++++++++++++++++++------------------------
>  sockets.c         |    2 +-
>  4 files changed, 58 insertions(+), 48 deletions(-)
> 

> -	if (write_img(fdset_fd(cr_fdset, CR_FD_FDINFO), &fe))
> +	if (!can_dump_unix_sk(sk))
>  		goto err;
>  
>  	if (sk->sd.already_dumped)
>  		return 0;

This should be BUG_ON()

> -	ue.id		= sk->sd.ino;
> +	ue.id		= id;

And about the restore -- this one works due to fds being sorted based on
their IDs to resolve "who restores and who accepts" question. Double check,
that this sorting doesn't get broken when you switch from one ID to two
(file id and socket ino).

Thanks,
Pavel


More information about the CRIU mailing list