[CRIU] [PATCH 1/3] crtools: resurrect --pid option for dump, v2

Pavel Emelyanov xemul at virtuozzo.com
Thu Mar 2 07:19:47 PST 2017


On 03/01/2017 01:09 AM, Ruslan Kuprieiev wrote:
> On 02/28/2017 05:24 PM, Pavel Emelyanov wrote:
> 
>> On 02/28/2017 03:19 PM, Ruslan Kuprieiev wrote:
>>> @@ -344,8 +345,8 @@ int main(int argc, char *argv[], char *envp[])
>>>   			opts.ext_unix_sk = true;
>>>   			break;
>>>   		case 'p':
>>> -			pid = atoi(optarg);
>>> -			if (pid <= 0)
>>> +			opts.pid = atoi(optarg);
>>> +			if (opts.pid <= 0)
>> I would just save the tree_id value here and set opts.one_shot = true.
>> Then in collect_pstree() just freeze root task and that's it.
>>
> 
> I've previously sent --root-only patch, but you pointed that it would be
> nice to reuse old --pid option, so I decided to prepare ground for a more
> general case of --pid specifying any task within tree(which, _in theory_ ,
> might be useful for cases when you want to freeze the tree but only
> interested in one task, like, for example, dumping a single worker that
> is a child of master process or something like that). What do you think
> about that potential general case?

Ah, so your proposal is to make --tree and --pid work together, where
the former one specifies what to freeze and the latter what to dump?

> I would honestly prefer introducing --one-shot(love the name, btw) 
> option for
> CLI/CAPI/RPC which is like --root-only from previous patch and be done 
> with it,
> as we definitely don't have any use cases(at least as of now) for more 
> general
> --pid option and I would be more than happy with --one-shot.
> .

For me the --one-shot says that some action should perform once, in case
of dump -- the dump one :) So if we want an additional option to --tree
I'd call one --root-only.

But actually making just the --pid option, that conflicts with the --tree
one and dumps single task would be easier to understand.

-- Pavel


More information about the CRIU mailing list