[CRIU] [PATCH 1/2] tty: Make parasite to consider major and minors
Pavel Emelyanov
xemul at parallels.com
Thu Oct 9 05:30:08 PDT 2014
On 10/09/2014 04:18 PM, Cyrill Gorcunov wrote:
> On Thu, Oct 09, 2014 at 03:35:15PM +0400, Pavel Emelyanov wrote:
>>> +
>>> + __tty_ioctl(TIOCGSID, args->sid);
>>> + __tty_ioctl(TIOCGPGRP, args->pgrp);
>>> + switch (args->major) {
>>> + case TTYAUX_MAJOR:
>>> + if (args->minor == 0 || args->minor == 2) {
>>> + __tty_ioctl(TIOCGPKT, args->st_pckt);
>>> + __tty_ioctl(TIOCGPTLCK, args->st_lock);
>>> + }
>>> + break;
>>> + case UNIX98_PTY_MASTER_MAJOR ... (UNIX98_PTY_MASTER_MAJOR + UNIX98_PTY_MAJOR_COUNT - 1):
>>> + case UNIX98_PTY_SLAVE_MAJOR:
>>> + __tty_ioctl(TIOCGPKT, args->st_pckt);
>>> + __tty_ioctl(TIOCGPTLCK, args->st_lock);
>>> + break;
>>> + }
>>
>> Please, don't re-introduce this switch() for the 3rd time. Make
>> all the decisions in files.c and go to parasite with simple questions :)
>
> Look, TIOCGPTLCK | TIOCGPKT should not be called on anything but
> pty peers so I either need to introduce own types and use "case"
> statement somewhere in files.c, or continue using "case" here.
We will support ttys "by type" and this will be reflected everywhere --
in the images, in the tty.c code, etc. Time to introduce the "type"
enum?
Thanks,
Pavel
More information about the CRIU
mailing list