[CRIU] Re: [PATCH 7/9] tty: dump -- Verify that only one external tty is present

Pavel Emelyanov xemul at parallels.com
Tue Oct 9 12:03:02 EDT 2012


On 10/09/2012 07:40 PM, Cyrill Gorcunov wrote:
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  cr-dump.c     |    2 +-
>  include/tty.h |    2 +-
>  tty.c         |   20 ++++++++++++++------
>  3 files changed, 16 insertions(+), 8 deletions(-)
> 


> @@ -1629,7 +1629,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->ext_tty);
>  	if (ret)
>  		goto err;
>  

The opts can be used widely, w/o passing all over the stacks.

> +			if (!ext_tty) {
> +				pr_err("Found slave peer index %d without "
> +				       "correspond master peer\n",
> +				       tty_get_index(i));
> +				return -1;
> +			}
> +
> +			if (j++ >= 1) {
> +				pr_err("Only one slave external peer "
> +				       "is allowed\n");
> +				return -1;
> +			}

You say, that the very first entry in the image may be unpaired. This is wrong.
_Any_ but _only_ _one_ may be such.



More information about the CRIU mailing list