[CRIU] [PATCH 1/2] tty: add vt support, v2

Pavel Emelyanov xemul at parallels.com
Fri Dec 19 08:05:54 PST 2014


> diff --git a/tty.c b/tty.c
> index b076f06..7b184c7 100644
> --- a/tty.c
> +++ b/tty.c
> @@ -118,6 +118,7 @@ static LIST_HEAD(all_ttys);
>  #define MAX_TTYS	1024
>  #define MAX_PTY_INDEX	1000
>  #define CONSOLE_INDEX	1002
> +#define VT_INDEX	1004

1004? Why not 1003 or 1005?

>  
>  static DECLARE_BITMAP(tty_bitmap, (MAX_TTYS << 1));
>  static DECLARE_BITMAP(tty_active_pairs, (MAX_TTYS << 1));
> @@ -534,13 +547,21 @@ static char *tty_name(int type)
>  		return "pts";
>  	case TTY_TYPE_CONSOLE:
>  		return "console";
> +	case TTY_TYPE_VT:
> +		return "tty";
>  	}
>  	return "unknown";
>  }
>  
>  static bool tty_is_master(struct tty_info *info)
>  {
> -	return info->type == TTY_TYPE_PTM || info->type == TTY_TYPE_CONSOLE;
> +	if (info->type == TTY_TYPE_PTM || info->type == TTY_TYPE_CONSOLE)
> +		return true;
> +
> +	if (info->type == TTY_TYPE_VT && !opts.shell_job)

Why is !opts.shell_job here?

> +		return true;
> +
> +	return false;
>  }
>  
>  static bool tty_is_hung(struct tty_info *info)



More information about the CRIU mailing list