[CRIU] custom initialization during restore

Pavel Emelyanov xemul at parallels.com
Tue Aug 11 04:11:09 PDT 2015


On 08/10/2015 09:42 PM, CRIU criu wrote:
> Can we also use the plugin to call a specific function in the target process?

Sure.

> If yes, does it have to be a fixed address or the plugin could be made aware of
> the function address dynamically (linking?)

Depends on how you write the plugin code. For ELF binaries it's
typically possible to resolve a routine address by its name.

If we're starting to talk about making criu communicate to the
process it dumps/restores, I would go the other way -- I'd make
a library (libcriume.so or smth like this) with which a binary
can be linked. In this library there should be a pre-defined set
of symbols that will be called/used by criu on dump/restore.
IOW -- it will be a plugin to programs, not to criu itself.

> On Thu, Jun 11, 2015 at 11:27 AM, CRIU criu <criuport at gmail.com <mailto:criuport at gmail.com>> wrote:
> 
>     Thanks! Let me take a look.
> 
>     On Thu, Jun 11, 2015 at 6:01 AM, Pavel Emelyanov <xemul at parallels.com <mailto:xemul at parallels.com>> wrote:
> 
>         On 06/11/2015 05:06 AM, CRIU criu wrote:
>         > Hi,
>         >
>         > How can I add custom initialization code to restorer before unmap and sigreturn?
>         > I'm trying to checkpoint /restore a single Android process. For external dependencies, I
>         > need to initialize Java objects collected as a part of memory dump by CRIU. The
>         > initialization code involves making a bunch of syscalls. Can I do this by creating a
>         > custom restorer blob or inside cr_restore_tasks() in cr-restore.c? Thanks!
> 
>         Hm :) Nice request. Right now there's no such ability in CRIU and I don't
>         see _easy_ solution. Complex solution can be plugin, that gets loaded into
>         restorer blob and that's called at the very end of restorer, but this would
>         require non-trivial preparation of the plugin itself. We've played with
>         such things before, you can dig deep into the pie/ code and into the
>         compel project (https://github.com/xemul/compel) for details :)
> 
>         -- Pavel
> 
> 
> 



More information about the CRIU mailing list