[CRIU] Re: [PATCH 5/6] tty: Update tty verification procedure

Pavel Emelyanov xemul at parallels.com
Tue Oct 16 12:04:42 EDT 2012


On 10/16/2012 11:27 AM, Cyrill Gorcunov wrote:
> 
> We need to make sure that the only one external tty
> is present, since otherwise we have no idea on which
> pts index to connect them on restore.
> 
> This patch extends tty_verify_active_pairs procedure to
> count how many external tty is present in the dump image.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  cr-dump.c     |    2 +-
>  include/tty.h |    2 +-
>  tty.c         |   23 +++++++++++++++++------
>  3 files changed, 19 insertions(+), 8 deletions(-)
> 


> @@ -1630,7 +1630,7 @@ int cr_dump_tasks(pid_t pid, const struct cr_options *opts)
>  	if (ret)
>  		goto err;
>  
> -	ret = tty_verify_active_pairs();
> +	ret = tty_verify_active_pairs(opts->shell_job);
>  	if (ret)
>  		goto err;
>  

> @@ -857,6 +865,9 @@ int collect_tty(void)
>  		ret = collect_image(CR_FD_TTY, PB_TTY,
>  				sizeof(struct tty_info),
>  				collect_one_tty);
> +	if (!ret)
> +		ret = tty_verify_active_pairs(true);
> +
>  	return ret;
>  }
>  

Why not symmetrical? Whey is restore always considered to "allow unpaired slaves"?


More information about the CRIU mailing list