[CRIU] Standard stream is not terminal

Pavel Emelyanov xemul at parallels.com
Mon Sep 1 13:14:50 PDT 2014


On 09/01/2014 10:23 PM, Cyrill Gorcunov wrote:
> On Mon, Sep 01, 2014 at 10:05:25PM +0400, Pavel Emelyanov wrote:
>> On 09/01/2014 09:52 PM, Cyrill Gorcunov wrote:
>>> On Mon, Sep 01, 2014 at 09:35:07PM +0400, Pavel Emelyanov wrote:
>>>>>>>
>>>>>>> We require stdin to be a terminal to inherit it when we're migrating pty. Look,
>>>>>>
>>>>>> Wait wait wait. The -j option is required _only_ when the task we dump
>>>>>
>>>>> This has nothing to do with -j option. What we're doing is
>>>>>
>>>>> crtools_prepare_shared
>>>>>   tty_prep_fds
>>>>>     trying to reserve stdin for future possible use
>>>>
>>>> This is to inherit terminal from parent. Why do we want this in Sanidhya case?
>>>
>>> Because we can :-) Just kidding. Look, it's simply how it's done now -- we don't
>>> know if we will ever need it or no -- and we reserve/check it early. The patch
>>> I sent to Sanidhya does the trick -- we reserve this descriptor but instead of
>>> testing it immediately if it's tty or not, we defer testing, thus if criu won't
>>> need to inherit terminal during the whole restore procedure, the problem Sanidhya
>>> is getting simply go away (if I don't miss something obvious what we do now is
>>> simply a nit and should be fixed with the patch I sent).
>>
>> No, I don't like it. If we don't need to inherit tty, we don't need the
>> -j option. If we do need, then it should be a tty from the very beginning.
> 
> At this moment of criu (ie early bootstrap procedure, we don't know yet if we
> would need to inherit tty or not, opening tty images goes a way latter than
> this early stage)
> .
> 

And -j option shouldn't work as "I'm not sure whether I would need a
tty, so let's supply one. Just in case.". It should be deterministic.
Does Sanidhya's case implies inheriting a tty? I _really_ doubt it.

Thanks,
Pavel



More information about the CRIU mailing list