[CRIU] [PATCH 1/3] crtools: resurrect --pid option for dump, v2
Ruslan Kuprieiev
kupruser at gmail.com
Tue Feb 28 14:09:10 PST 2017
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?
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.
More information about the CRIU
mailing list