[CRIU] [PATCH 3/3] plugins: Use new plugins engine

Cyrill Gorcunov gorcunov at openvz.org
Thu Feb 27 10:22:10 PST 2014


While diff might be a bit scary, the idea behind is pretty
simple

 -- all plugins have plugins descriptor, defined as
    CR_PLUGIN_DESC, this variable is looked up in
    library global symbols. Once found, we take the
    descriptor and collect it into own list @cr_plugins_list

 -- every plugin provides a set of hooks which it going
    to handle, so once we need to call some particular
    hook we walk over all plugins in the global list
    and check if there a hook handler assigned in plugin,
    if yes -- simply call it.

This allows us to drop off some code and run a plugin
helpers as

	| run_plugin_hooks(hook-number, arg1, arg2, arg3);

In case if plugin is compiled with old API -- we generate
pseudodescriptor and assign hooks by hands, hopefully
we could drop off old API in a couple of releases.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 files-ext.c      |   4 +-
 include/plugin.h |  32 +++++++++
 mount.c          |   6 +-
 net.c            |   2 +-
 plugin.c         | 206 ++++++++++++++++++-------------------------------------
 sk-unix.c        |   4 +-
 6 files changed, 108 insertions(+), 146 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-plugins-Use-new-plugins-engine.patch
Type: text/x-patch
Size: 11235 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20140227/2f68eae4/attachment-0001.bin>


More information about the CRIU mailing list