[CRIU] [PATCH 1/6] tty: Rework tty_driver structure

Pavel Emelyanov xemul at parallels.com
Thu Apr 2 08:28:37 PDT 2015


On 04/02/2015 06:12 PM, Cyrill Gorcunov wrote:
> On Thu, Apr 02, 2015 at 06:04:41PM +0300, Pavel Emelyanov wrote:
>>
>>> @@ -182,19 +180,16 @@ static struct tty_driver ptm_driver = {
>>>  static int open_simple_tty(struct tty_info *info);
>>>  
>>>  static struct tty_driver console_driver = {
>>> -	.t			= TTY_TYPE_CONSOLE,
>>> -	.flags			= TTY_MASTER,
>>> +	.type			= TTY_TYPE__CONSOLE,
>>> +	.subtype		= TTY_SUBTYPE_SLAVE,
>>
>> Why slave? This breaks some codepaths below.
> 
> Which one it breaks? 

The pty_alloc_fake_reg(), but it looks like it's not called for CONSOLE.

> The console is a slave by definition.

O_o   What's the definition?

> If you mean tty_is_master() helper then it's different
> context -- it means we don't have to open master peer
> for it, and because the console is special and the program
> only has one peer of it (always) that's why it is slave
> by nature but "master" in terms of criu.

OK, let's assume it's such. Why isn't VT slave then? Maybe not
assign _any_ types on both and keep them for PTYs only?

-- Pavel



More information about the CRIU mailing list