[CRIU] Re: [PATCH 6/9] pstree: Allow to dump and restore session
non-leaders if --ext-tty passed
Pavel Emelyanov
xemul at parallels.com
Tue Oct 9 13:08:03 EDT 2012
On 10/09/2012 08:09 PM, Cyrill Gorcunov wrote:
> On Tue, Oct 09, 2012 at 08:01:35PM +0400, Pavel Emelyanov wrote:
>>> @@ -1614,7 +1614,7 @@ int cr_dump_tasks(pid_t pid, const struct cr_options *opts)
>>> if (dump_zombies())
>>> goto err;
>>>
>>> - if (dump_pstree(root_item))
>>> + if (dump_pstree(root_item, opts))
>>> goto err;
>>>
>>> if (opts->namespaces_flags)
>>
>> The opts is a good global variable, no need in passing it all over the stack.
>
> OK, will update.
>
>>> + /*
>>> + * Make sure we're dumping session leader, if not an
>>> + * appropriate option must be passed. Another ruse is
>>> + * that to restore external tty connections we need to
>>> + * inherit process group as well, thus zap it here.
>>> + */
>>> + if (root_item->pid.virt != root_item->sid) {
>>
>> I think we need a comment, why root's session leader can't sit somewhere
>> in the subtree _below_ it.
>
> Actually I don't get how can we have root session leader somewhere
> below the root. The root either session leader either belongs to
> some session. What I'm missing here?
Reparenting.
More information about the CRIU
mailing list