No description
Find a file
Cyrill Gorcunov 3146f58317 plugin: Rework plugins API, v2
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>
2014-09-03 20:48:36 +04:00
arch Dump capabilities from the parasite 2014-08-15 23:10:44 +04:00
Documentation Small spelling fixes in criu.8 manpage 2014-08-04 13:09:54 +04:00
include plugin: Rework plugins API, v2 2014-09-03 20:48:36 +04:00
lib libcriu: Add criu_add_cg_root() call 2014-08-22 19:20:06 +04:00
pie criu: Drop redundant newline from pr_perror 2014-08-22 19:22:39 +04:00
protobuf rpc: Add "cgroup root" fields to criu_opts 2014-08-22 19:20:04 +04:00
scripts crtools: check for setproctitle_init 2014-09-02 16:14:39 +04:00
test test: Don't compare PIDs when searching for our locks 2014-09-02 19:09:47 +04:00
.gitignore lib: Generate pkgconfig file 2014-08-04 13:57:18 +04:00
.mailmap repo: Add mailmap file 2012-03-25 23:31:20 +04:00
cgroup.c cgroups: don't take into account a leading / for the "/" parent 2014-08-26 12:51:06 +04:00
COPYING Add LGPL licence for library directory 2013-04-01 12:29:06 +04:00
cr-check.c eventpoll: parse_fdinfo_pid_s() returns allocated object for eventpol tfd 2014-09-02 16:08:17 +04:00
cr-dedup.c v2 page-read: rework open_page_read to use in shmem restore 2014-03-18 11:48:58 +04:00
cr-dump.c plugin: Rework plugins API, v2 2014-09-03 20:48:36 +04:00
cr-exec.c criu: Several formatting fixes 2014-01-14 09:33:19 +04:00
cr-restore.c plugin: Rework plugins API, v2 2014-09-03 20:48:36 +04:00
cr-service.c service: use setproctitle 2014-09-02 16:15:20 +04:00
cr-show.c show: Print filelocks.img pids as %u 2014-08-12 15:45:34 +04:00
CREDITS Add the CREDITS file 2012-07-30 13:52:37 +04:00
crtools crtools: rename binary to criu 2013-04-30 20:17:55 +04:00
crtools.c service: use setproctitle 2014-09-02 16:15:20 +04:00
eventfd.c anon-inode: Don't readlink fd/fd multiple times 2014-02-02 22:14:29 +04:00
eventpoll.c eventpoll: parse_fdinfo_pid_s() returns allocated object for eventpol tfd 2014-09-02 16:08:17 +04:00
fifo.c files: Fix open_path() to provide mntns root fd to callbacks 2014-06-06 12:20:02 +04:00
file-ids.c files-ids: generate id-s accoding with mnt_id, st->st_dev and st->st_ino 2014-04-21 22:39:28 +04:00
file-lock.c locks: Check for --file-locks option when real locks are found 2014-09-02 20:20:47 +04:00
files-ext.c plugin: Rework plugins API, v2 2014-09-03 20:48:36 +04:00
files-reg.c files: don't check uninitialized memory in create_link_remap() 2014-08-20 14:02:43 +04:00
files.c locks: Don't dump locks in per-task manner (v3) 2014-09-02 17:44:46 +04:00
fsnotify.c fsnotify: fix exit code of dump_inotify_entry() 2014-09-02 17:56:48 +04:00
image-desc.c locks: Fix restore from v1.2 images 2014-08-20 17:38:36 +04:00
image.c cg: Restore tasks into proper cgroups 2014-05-27 23:48:06 +04:00
ipc_ns.c ipc: set the msgmni sysctl after auto_msgmni 2014-08-14 12:21:43 +04:00
irmap.c mnt: Turn mntns_get_root_fd into accepting mnt ns_id 2014-04-23 02:31:16 +04:00
kcmp-ids.c kcmp: Fix ret code comparison 2014-04-22 12:51:15 +04:00
kerndat.c Dump capabilities from the parasite 2014-08-15 23:10:44 +04:00
libnetlink.c netlink: Lower netlink error report log level 2013-07-04 15:49:02 +04:00
log.c log: Don't override -v0 with -v2 2014-02-04 20:54:25 +04:00
Makefile test: clean the "test" directory from test/Makefile 2014-09-02 16:10:55 +04:00
Makefile.config crtools: check for setproctitle_init 2014-09-02 16:14:39 +04:00
Makefile.crtools Added AUFS support. 2014-08-21 18:35:22 +04:00
Makefile.inc install: install criu-service logrotate config 2014-02-18 12:39:50 +04:00
mem.c vdso: dump -- Don't dump contents of vvar zone 2014-06-24 22:48:41 +04:00
mount.c plugin: Rework plugins API, v2 2014-09-03 20:48:36 +04:00
namespaces.c ns: initialize nsid in rst_add_ns_id 2014-04-23 14:46:19 +04:00
net.c plugin: Rework plugins API, v2 2014-09-03 20:48:36 +04:00
netfilter.c iptables: use cr_system instead of system 2013-10-02 20:09:37 +04:00
page-pipe.c iov: Add iov_init() helper 2014-06-20 16:35:51 +04:00
page-read.c iov: Add iovec2pagemap() helper 2014-06-20 16:35:52 +04:00
page-xfer.c iov: Add page_server_iov to iov and back helpers 2014-06-20 16:35:54 +04:00
pagemap-cache.c pagemap-cache: Use page.h helpers 2014-02-21 16:29:41 +04:00
parasite-syscall.c criu: Drop redundant newline from pr_perror 2014-08-22 19:22:39 +04:00
pipes.c crtools: move pid_rst_prio to pid.h 2013-11-06 18:18:12 +04:00
plugin.c plugin: Rework plugins API, v2 2014-09-03 20:48:36 +04:00
proc_parse.c locks: Don't skip out-of-tree flocks 2014-09-02 19:54:28 +04:00
protobuf-desc.c timerfd: Add protobuf entries into the image 2014-08-06 19:18:34 +04:00
protobuf.c img: Add ability to check whether optional image collection happened 2014-08-12 14:38:22 +04:00
pstree.c mount: Don't create kids with CLONE_NEWNS 2014-05-12 14:20:17 +04:00
ptrace.c unseize: Don't print error when unseizing stopped task into stopped state 2013-12-20 23:22:04 +04:00
rbtree.c code: Fix spaced indentation where found 2012-08-11 21:36:03 +04:00
README Update README file so that it looks more informative on github front page 2014-01-24 20:42:08 +04:00
rst-malloc.c whitespace-at-eol cleanup 2013-12-12 10:00:45 +04:00
sd-daemon.c systemd socket activation support 2013-12-12 09:58:50 +04:00
sd-daemon.h systemd socket activation support 2013-12-12 09:58:50 +04:00
security.c security: skip obtaining additional groups for root, as they don't matter 2014-08-06 18:58:44 +04:00
shmem.c shmem: Fix format of printing shmem addresses 2014-08-19 13:00:09 +04:00
sigframe.c sigframe: cast the pointer to the field ucontext::uc_sigmask to k_rtsigset_t 2014-04-08 15:36:09 +04:00
signalfd.c anon-inode: Don't readlink fd/fd multiple times 2014-02-02 22:14:29 +04:00
sk-inet.c tcp: don't forget to wake up the port->users futex 2014-07-08 17:43:54 +04:00
sk-netlink.c util: add a function to check output data in a file descriptor 2014-09-02 16:25:50 +04:00
sk-packet.c vma: Turn embeded VmaEntry on vma_area into pointer 2014-02-04 11:44:01 +04:00
sk-queue.c crtools: move pid_rst_prio to pid.h 2013-11-06 18:18:12 +04:00
sk-tcp.c criu: rename current_ns_mask to root_ns_mask (v2) 2014-04-21 22:38:33 +04:00
sk-unix.c plugin: Rework plugins API, v2 2014-09-03 20:48:36 +04:00
sockets.c criu: rename current_ns_mask to root_ns_mask (v2) 2014-04-21 22:38:33 +04:00
stats.c stats: Properly initialize dump stats 2014-08-12 14:37:51 +04:00
string.c string: Add strlcat helper 2013-11-29 15:36:07 +04:00
sysctl.c sysctl: don't write '\0' at the end of buffer in a sysctl file 2014-08-14 12:21:48 +04:00
sysfs_parse.c Use --root instead of --aufs-root 2014-08-27 14:31:40 +04:00
timerfd.c criu: Drop redundant newline from pr_perror 2014-08-22 19:22:39 +04:00
tty.c tty: open tty-s with O_NOCTTY 2014-08-15 13:28:16 +04:00
tun.c criu: rename current_ns_mask to root_ns_mask (v2) 2014-04-21 22:38:33 +04:00
util.c util: add a function to check output data in a file descriptor 2014-09-02 16:25:50 +04:00
uts_ns.c crtools: move pid_rst_prio to pid.h 2013-11-06 18:18:12 +04:00

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