[CRIU] Re: [PATCH 9/9] tty: restore -- Migrate tty slave peer connection

Pavel Emelyanov xemul at parallels.com
Tue Oct 9 12:04:22 EDT 2012


On 10/09/2012 07:40 PM, Cyrill Gorcunov wrote:
> 
> In case if we've dumped a slave peer only (say a user dumped
> `top' application) we should migrate it on current active
> terminal, which barely an own standart stream prepared for us
> by file engine.
> 
> Note only one external slave peer is allowed simply because
> otherwise we can't distinguish which indices should be used
> for each of them.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  tty.c |   66 ++++++++++++++++++++++++++++++++++++++++++++++++++--------------
>  1 files changed, 51 insertions(+), 15 deletions(-)
> 


Please, split the patch. It's unreadable.

> +	/*
> +	 * We may have 2 cases here:
> +	 *
> +	 *  - @termios present thus it's external slave peer
> +	 *    which should be migrated on current pts
> +	 *
> +	 *  - no @termios means the peer is dead so we need
> +	 *    a fake master peer
> +	 */
>  
> -	master = pty_open_ptmx_index(O_RDONLY, slave->tie->pty->index);
> -	if (master < 0) {
> -		pr_perror("Can't open fale %x (index %d)",
> -			  slave->tfe->id, slave->tie->pty->index);
> -		return -1;
> -	}
> +	if (likely(slave->tie->termios)) {

slave->tie->termios == external slave peer is bad alias. Plz fix, taking int
account the 7th patch comments.


More information about the CRIU mailing list