[CRIU] Re: [PATCH 1/6] Add separate lists for master/slave fd on restore

Pavel Emelyanov xemul at parallels.com
Tue Sep 11 13:37:19 EDT 2012


On 09/11/2012 05:17 PM, Cyrill Gorcunov wrote:
> 
> When we will be restoring ttys we need that restore
> procedure for master peers will be yielded earlier
> than for slave peers due to ttys specifics. With this
> commit we introduce @tty_masters and @tty_slaves
> lists which will allow us to order tty file restore
> procesure.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  files.c           |   16 ++++++++++++++++
>  include/crtools.h |    2 ++
>  2 files changed, 18 insertions(+), 0 deletions(-)
> 
> @@ -498,6 +500,20 @@ int prepare_fds(struct pstree_item *me)
>  			if (ret)
>  				goto done;
>  		}
> +
> +		/*
> +		 * Now handle TTYs. Masters first, then slaves.
> +		 */
> +		list_for_each_entry(fle, &me->rst->tty_masters, ps_list) {
> +			ret = open_fdinfo(me->pid.virt, fle, state);
> +			if (ret)
> +				goto done;
> +		}
> +		list_for_each_entry(fle, &me->rst->tty_slaves, ps_list) {
> +			ret = open_fdinfo(me->pid.virt, fle, state);
> +			if (ret)
> +				goto done;
> +		}

I believe eventfds should still be last on this list.

>  	}
>  done:
>  	return ret;




More information about the CRIU mailing list