[CRIU] [PATCH v2 31/57] proc_parse: Implement collect_pid_status()
Dmitry Safonov
0x7f454c46 at gmail.com
Tue Apr 11 09:33:33 PDT 2017
2017-04-11 19:21 GMT+03:00 Kirill Tkhai <ktkhai at virtuozzo.com>:
> On 10.04.2017 11:02, Kirill Tkhai wrote:
>> On 07.04.2017 08:16, Andrei Vagin wrote:
>>> On Tue, Mar 28, 2017 at 06:38:50PM +0300, Kirill Tkhai wrote:
>>>> Implement helper, which allows to collect NSpids in
>>>> the whole pid hierarhy (i.e., when pid->level > 1).
>>>>
>>>
>>> We already have parse_pid_status(). Can we read /proc/pid/status for
>>> each process only once?
>>
>> Hm. We use compel interface to call parse_pid_status():
>>
>> int compel_wait_task(int pid, int ppid,
>> int (*get_status)(int pid, struct seize_task_status *),
>> struct seize_task_status *ss)
>>
>> The interface works with struct seize_task_status. Can we change it to use
>> new type, containing status and ns_pids?
>
> We spoke, but let's speak one more time. So, is OK the following change?
/a side-note/
It's compel's UAPI, so if you really need this change, it should go
separate from your series and got into master until v3.0 release.
As compel is a part of that release - uapi will be cut in stone.
Or at least, it's expected to be so.
>
> diff --git a/compel/include/uapi/infect.h b/compel/include/uapi/infect.h
> index f6366444c..ce9ca3eea 100644
> --- a/compel/include/uapi/infect.h
> +++ b/compel/include/uapi/infect.h
> @@ -30,8 +30,8 @@ struct seize_task_status {
> };
>
> extern int compel_wait_task(int pid, int ppid,
> - int (*get_status)(int pid, struct seize_task_status *),
> - struct seize_task_status *st);
> + int (*get_status)(int pid, struct seize_task_status *, void *data),
> + struct seize_task_status *st, void *data);
>
> extern int compel_stop_task(int pid);
> extern int compel_resume_task(pid_t pid, int orig_state, int state);
>
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
--
Dmitry
More information about the CRIU
mailing list