[CRIU] Re: [PATCH cr 10/12] pipes: restore pipes data

Pavel Emelyanov xemul at parallels.com
Thu Apr 5 08:08:29 EDT 2012


On 04/05/2012 03:47 PM, Andrey Vagin wrote:
> 
> Restore all data in a one place.
> Pipes data are saved in a file and they saved together with
> a read tail, but they may be restored only with a write tail.
> 
> So we have to way:
> * Find data in a file for each pipe
> * Find pipe for each portion of data
> 
> Information about pipes are saved in memory, so I choose this way.
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  cr-restore.c    |    2 +
>  include/files.h |    1 +
>  pipes.c         |   76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 79 insertions(+), 0 deletions(-)
> 

This looks ugly :( Why not take this check:

> +			if (pi->pe.pipe_id != pe.pipe_id ||
> +			    !(pi->pe.flags & O_WRONLY) ||
> +			    list_empty(&pi->fd_head))
> +				continue;

and make one of the pipe openers check this and refill the pipe?


More information about the CRIU mailing list