[CRIU] [PATCH 07/12] parasite: Extend tid_state_s structure
Pavel Emelyanov
xemul at parallels.com
Fri Mar 1 14:45:18 EST 2013
On 03/01/2013 11:31 PM, Cyrill Gorcunov wrote:
> On Fri, Mar 01, 2013 at 10:51:19PM +0400, Pavel Emelyanov wrote:
>>> diff --git a/pie/parasite.c b/pie/parasite.c
>>> index 3b2617c..c8b5f60 100644
>>> --- a/pie/parasite.c
>>> +++ b/pie/parasite.c
>>> @@ -20,9 +20,11 @@ static int tsock = -1;
>>> static int ctlsock = -1;
>>>
>>> static struct tid_state_s {
>>> + unsigned int id;
>>
>> Isn't tid good enough to address thread? Why?
>
> We don't know tids at moment when we inject parasite code (especially
> when we dump in namespaces, we have
You map id to tid anyway, why not just use it all over the workflow?
> int parasite_dump_thread_seized(struct parasite_ctl *ctl, struct pid *tid,
> CoreEntry *core)
> {
> struct parasite_dump_thread *args;
> int ret;
>
> args = parasite_args(ctl, struct parasite_dump_thread);
> ret = parasite_execute_by_pid(PARASITE_CMD_DUMP_THREAD, ctl, tid->real);
> ...
> --> tid->virt = args->tid;
> core_put_tls(core, args->tls);
> }
>
> routine to fetch the tid back to crtools code.
>
> Actually, initially I used tids for that -- I did sharing of tid_state_s
> structure between parasiet-syscall.c and parasite blob itself. But eventually
> the less things we share between crtools and parasite blob then better bacause
> it isolate parasite from the rest of program.
>
> Thus, now it's abstract @id which crtools pass to parasite code asking a daemon
> to serve some request. This @id must be unique between all threads, and crtools
> uses global pids for that.
> .
>
More information about the CRIU
mailing list