[CRIU] [PATCH 0/9] add ability to set callbacks for external sockets (v7)

Andrey Vagin avagin at openvz.org
Thu Dec 19 09:34:56 PST 2013


We don't know a state behind an external socket. It depends on logic
of the program, which handles this socket.

The patch adds ability to load a library with callbacks for dumping
and restoring external sockets, character devices. In a future we can
add callbacks for other external objects.

Now a library can have:
* two functions cr_plugin_init and cr_plugin_fini, which are called
  on loading and unloading.
* two callbacks cr_plugin_{dump,restore}_unix_sk for dumping and restoring
  unix sockets.
* two callbacks cr_plugin_{dump,restore}_file for character devices.

If a callback can not handle an object, it must return CRIU_CB_SKIP.

v2: * Scan libraries in a predefined directory. The path cab be set by
      the -L option or the CRIU_LIBS_DIR environment
    * Look up all callbacks on loading of libraries
    * The test uses two libraries
v3: add callbacks for character devices.
v4: rework callbacks for dumping files.
v5: use -ENOTSUP instead of CRIU_CB_SKIP
    open files in the criu_plugin_restore_files() callbacks
v6: set USK_CALLBACK, if a socket was dumped by callback
v7: add separate type for unsupported files



More information about the CRIU mailing list