[CRIU] [PATCH v2 31/57] proc_parse: Implement collect_pid_status()

Kirill Tkhai ktkhai at virtuozzo.com
Tue Apr 11 09:21:18 PDT 2017


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?

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);



More information about the CRIU mailing list