[CRIU] [PATCH 1/3]v3 libcriu: criu_dump_me() and library header

Pavel Emelyanov xemul at parallels.com
Fri Aug 30 06:57:12 EDT 2013


On 08/30/2013 02:16 PM, Pavel Emelyanov wrote:
> On 08/30/2013 11:37 AM, Andrew Vagin wrote:
>> On Thu, Aug 29, 2013 at 11:08:23PM +0400, Ruslan Kuprieiev wrote:
>>> Hi!
>>>
>>> Patch 1\3 contains criu_dump_me() for library and library header.
>>>        -- criu_dump_me() gets an argument of  type struct criu_dump_args
>>> from user program,
>>>          processes it and sends request to criu through unix domain
>>> socket.
>>>          Then, it gets flag from criu and returns it back to program.
>>>        -- libcriu.h contains definitions of flags, struct
>>> criu_dump_args etc.
>>>           So, it is to be used in user program.
>>
>> Do we want to invent own RPC?
>>
>> http://en.wikipedia.org/wiki/Remote_procedure_call
>>
>> Can we use something well-known, which has bindings for all popular
>> languages?
> 
> Please, propose one. The must-have requirement -- on criu service side we
> do need to know the PID of the caller, that cannot be obfuscated by the
> client. E.g. unix sockets' SO_PEERCRED is such.

I have better idea. We declare the "way to talk to criu service" as

1. unix socket
2. protobuf message with request
3. protobuf message with response

It's pretty much like JSON-RPC, but we don't have to mess with yet another
"language" for encoding messages by just using protobufs.

For convenience we can provide a C-call in libcriu.so that packs arguments
into protobuf object and sends one to the service. All the rest is as it was
in previous discussion.

Thanks,
Pavel


More information about the CRIU mailing list