mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
No description
blcrcheckpointcontainercontainerscriudmtcphighly-availablelinuxmemory-trackingmigrationparasitepost-copyrestoresnapshotsuspenduserfaultfdzero-downtime
Here we define new api to be used in plugins.
- Plugin should provide a descriptor with help of
CR_PLUGIN_REGISTER macro, or in case if plugin require
no init/exit functions -- with CR_PLUGIN_REGISTER_DUMMY.
- Plugin should define a plugin hook with help of
CR_PLUGIN_REGISTER_HOOK macro.
- Now init/exit functions of plugins takes @stage
argument which tells plugin which stage of criu
it's been called on dump/restore. For exit it
also takes @ret which allows plugin to know if
something went wrong and it needs to cleanup
own resources.
The idea behind is to not limit plugins authors with names
of functions they might need to use for particular hook.
Such new API deprecates olds plugins structure but to keep
backward compatibility we will provide a tiny layer of
additional code to support old plugins for at least a couple
of release cycles.
For example a trivial plugin might look like
| #include <sys/types.h>
| #include <sys/stat.h>
| #include <fcntl.h>
| #include <libgen.h>
| #include <errno.h>
|
| #include <sys/socket.h>
| #include <linux/un.h>
|
| #include <stdio.h>
| #include <stdlib.h>
| #include <string.h>
| #include <unistd.h>
|
| #include "criu-plugin.h"
| #include "criu-log.h"
|
| static int dump_ext_file(int fd, int id)
| {
| pr_info("dump_ext_file: fd %d id %d\n", fd, id);
| return 0;
| }
|
| CR_PLUGIN_REGISTER_DUMMY("trivial")
| CR_PLUGIN_REGISTER_HOOK(CR_PLUGIN_HOOK__DUMP_EXT_FILE, dump_ext_file)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
|
||
|---|---|---|
| arch | ||
| Documentation | ||
| include | ||
| lib | ||
| pie | ||
| protobuf | ||
| scripts | ||
| test | ||
| .gitignore | ||
| .mailmap | ||
| cgroup.c | ||
| COPYING | ||
| cr-check.c | ||
| cr-dedup.c | ||
| cr-dump.c | ||
| cr-exec.c | ||
| cr-restore.c | ||
| cr-service.c | ||
| cr-show.c | ||
| CREDITS | ||
| crtools | ||
| crtools.c | ||
| eventfd.c | ||
| eventpoll.c | ||
| fifo.c | ||
| file-ids.c | ||
| file-lock.c | ||
| files-ext.c | ||
| files-reg.c | ||
| files.c | ||
| fsnotify.c | ||
| image-desc.c | ||
| image.c | ||
| ipc_ns.c | ||
| irmap.c | ||
| kcmp-ids.c | ||
| kerndat.c | ||
| libnetlink.c | ||
| log.c | ||
| Makefile | ||
| Makefile.config | ||
| Makefile.crtools | ||
| Makefile.inc | ||
| mem.c | ||
| mount.c | ||
| namespaces.c | ||
| net.c | ||
| netfilter.c | ||
| page-pipe.c | ||
| page-read.c | ||
| page-xfer.c | ||
| pagemap-cache.c | ||
| parasite-syscall.c | ||
| pipes.c | ||
| plugin.c | ||
| proc_parse.c | ||
| protobuf-desc.c | ||
| protobuf.c | ||
| pstree.c | ||
| ptrace.c | ||
| rbtree.c | ||
| README | ||
| rst-malloc.c | ||
| sd-daemon.c | ||
| sd-daemon.h | ||
| security.c | ||
| shmem.c | ||
| sigframe.c | ||
| signalfd.c | ||
| sk-inet.c | ||
| sk-netlink.c | ||
| sk-packet.c | ||
| sk-queue.c | ||
| sk-tcp.c | ||
| sk-unix.c | ||
| sockets.c | ||
| stats.c | ||
| string.c | ||
| sysctl.c | ||
| sysfs_parse.c | ||
| timerfd.c | ||
| tty.c | ||
| tun.c | ||
| util.c | ||
| uts_ns.c | ||
criu ==== An utility to checkpoint/restore tasks. Using this tool, you can freeze a running application (or part of it) and checkpoint it to a hard drive as a collection of files. You can then use the files to restore and run the application from the point it was frozen at. The distinctive feature of the CRIU project is that it is mainly implemented in user space. The project home is at http://criu.org Pages worth starting with are * Kernel configuration, compilation, etc: http://criu.org/Installation * A simple example of usage: http://criu.org/Simple_loop * More sophisticated example with graphical app: http://criu.org/VNC