[CRIU] [PATCH 6/6] pycriu: add criu class
Pavel Emelyanov
xemul at parallels.com
Thu Oct 15 04:55:26 PDT 2015
On 10/15/2015 02:44 PM, Ruslan Kuprieiev wrote:
>
>
> On 10/15/2015 02:38 PM, Pavel Emelyanov wrote:
>>> +class criu:
>>> + """
>>> + Call criu through RPC.
>>> + """
>>> + opts = None #CRIU options in pb format
>>> +
>>> + _comm = None #Communication method
>>> +
>>> + def __init__(self):
>>> + self.use_binary('criu')
>>> + self.opts = rpc.criu_opts()
>> So default opts are always to be used, right? How can caller change them?
>
> To change comm method user could just use use_{sk,fd,bin} methods listed
> below.
>
> Pb opts are just accessed like criu.opts.pid = 123456. User is able to
> provide its own
> instance of pb opts by just doing criu.opts = my_opts, and criu class
> will take care
> of merging them into request(this is an important part, as if i recall
> correctly, in python
> implementation of protobuf you can't just req.opts = my_opts).
Ah! Cool.
-- Pavel
More information about the CRIU
mailing list