[CRIU] Re: [PATCH cr 08/12] pipe: choose who will restore a pipe
Pavel Emelyanov
xemul at parallels.com
Thu Apr 5 08:02:22 EDT 2012
On 04/05/2012 03:47 PM, Andrey Vagin wrote:
>
> Add a new function, which will be executed when all fdinfo-s
> collected.
> A pipe will be restored by a process with minimal pid and
> for descriptor with minimal number.
>
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
> cr-restore.c | 2 +
> include/files.h | 1 +
> pipes.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 60 insertions(+), 0 deletions(-)
>
> + while (1) {
> + struct fdinfo_list_entry *fle;
> + struct pipe_info *pi, *pic, *p;
> + int fd, pid;
> +
> + if (list_empty(&pipes))
> + break;
> +
> + pi = list_first_entry(&pipes, struct pipe_info, list);
> + list_move(&pi->list, &head);
[snip]
> + }
> +
> + list_splice(&head, &pipes);
Why not simple walk over pipes?
More information about the CRIU
mailing list