[CRIU] [GIT PULL] tools, cpt2: Initial merge
Cyrill Gorcunov
gorcunov at openvz.org
Mon May 27 05:58:24 EDT 2013
Pavel, I would like to ask you merging initiall commit
for cpt2 tool, which I commit as having alfa stage now.
I'm putting pull request and text from the commit itself
for better understanding of the tool details.
Note I didn't touch even signle file in criu sourse
since I think the only entities are to be shared between
criu and cpt2 -- headers and built-in targets.
---
commit f26adfc238124034e38fd8f10f37f80bfb95ac63
Author: Cyrill Gorcunov <gorcunov at openvz.org>
Date: Thu May 23 14:05:34 2013 +0400
tools: cpt2 -- Initial commit
Here is an initial commit for cpt2 tool. cpt2 stands for "checkpoint to"
and its main purpose to convert OpenVZ dump files to criu format.
The following entries are were converted in this alfa release
(it's easier to count what is supported rather than missing :)
- signal handlers
- task states (gpr,fpu), creds
- regualr files (including pipes, but without pipe data)
- tty
- mount points
- memory (including vdso)
- unix/inet/netlink sockets
An easy way to test it (as I did) is to make a suspend under
OpenVZ kernel with vzctl help, then reboot to latest vanilla
kernel (or criu kernel), mount container root filesystem to
some new root, say
mount --bind /vz/private/101 /vz/root/101/
(don't forget to call for mount --make-rprivate /vz/root/101/
after). Then run converter, for example
./cpt2 -v 4 -D test/out/ -f test/101.cpt --root /vz/private/101/
which produce really a *lot* of debug information on your terminal.
And finally run criu restore procedure (after reboot to a proper
kernel of course)
./criu restore -v 4 -D tools/cpt2/test/out/ --root=/vz/root/101/
In my simple testing case I've got the following process tree after restore
| 11481 pts/2 S+ 0:00 | \_ ./criu restore -v 4 -D tools/cpt2/test/out/ --root=/vz/root/101/
| 11485 ? Ss 0:00 | \_ init
| 11494 ? Ss 0:00 | \_ /sbin/udevd -d
| 11495 ? Ss 0:00 | \_ /usr/sbin/sshd
| 11496 ? Ss 0:00 | \_ xinetd -stayalive -pidfile /var/run/xinetd.pid
| 11497 ? Ss 0:00 | \_ /usr/sbin/saslauthd -m /var/run/saslauthd -a pam -n 2
| 11507 ? S 0:00 | | \_ /usr/sbin/saslauthd -m /var/run/saslauthd -a pam -n 2
| 11498 ? Ss 0:00 | \_ sendmail: accepting connections
| 11499 ? Ss 0:00 | \_ sendmail: Queue runner at 01:00:00 for /var/spool/clientmqueue
| 11500 ? S 0:00 | \_ /sbin/rsyslogd -i /var/run/syslogd.pid -c 4
| 11501 ? S 0:00 | \_ /sbin/rsyslogd -i /var/run/syslogd.pid -c 4
| 11502 ? S 0:00 | \_ /sbin/rsyslogd -i /var/run/syslogd.pid -c 4
| 11504 ? Ss 0:00 | \_ /usr/sbin/httpd
| 11509 ? S 0:00 | | \_ /usr/sbin/httpd
| 11505 ? Ss 0:00 | \_ crond
And yet don't expect anything magic, it's alfa stage of the tool
which will be heavily lifted, thus no use for anything but
testing purpose.
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
The following changes since commit d79fc6d3750d67bcf69f12190295421971deb9a7:
parasite: use a correct original registers (2013-05-27 13:10:44 +0400)
are available in the git repository at:
git://github.com/cyrillos/crtools.git cpt2-v0.1
for you to fetch changes up to f26adfc238124034e38fd8f10f37f80bfb95ac63:
tools: cpt2 -- Initial commit (2013-05-27 13:46:03 +0400)
----------------------------------------------------------------
Cyrill Gorcunov (1):
tools: cpt2 -- Initial commit
tools/cpt2/Documentation/.gitattributes | 1 +
tools/cpt2/Documentation/.gitignore | 3 +
tools/cpt2/Documentation/Makefile | 18 +
tools/cpt2/Documentation/cpt2.txt | 37 +
tools/cpt2/Makefile | 127 +++
tools/cpt2/README.md | 8 +
tools/cpt2/src/Makefile | 28 +
tools/cpt2/src/context.c | 55 +
tools/cpt2/src/convert.c | 186 ++++
tools/cpt2/src/epoll.c | 147 +++
tools/cpt2/src/fdset.c | 49 +
tools/cpt2/src/files.c | 674 ++++++++++++
tools/cpt2/src/fsnotify.c | 318 ++++++
tools/cpt2/src/image-defs.c | 79 ++
tools/cpt2/src/image.c | 87 ++
tools/cpt2/src/include/context.h | 47 +
tools/cpt2/src/include/convert.h | 6 +
tools/cpt2/src/include/cpt-image.h | 1820 +++++++++++++++++++++++++++++++
tools/cpt2/src/include/cpt2.h | 18 +
tools/cpt2/src/include/epoll.h | 23 +
tools/cpt2/src/include/fdset.h | 38 +
tools/cpt2/src/include/files.h | 57 +
tools/cpt2/src/include/fsnotify.h | 34 +
tools/cpt2/src/include/hashtable.h | 156 +++
tools/cpt2/src/include/image-defs.h | 106 ++
tools/cpt2/src/include/image.h | 28 +
tools/cpt2/src/include/io.h | 46 +
tools/cpt2/src/include/log.h | 68 ++
tools/cpt2/src/include/magicfs.h | 12 +
tools/cpt2/src/include/mm.h | 105 ++
tools/cpt2/src/include/net.h | 82 ++
tools/cpt2/src/include/ns.h | 39 +
tools/cpt2/src/include/obj.h | 230 ++++
tools/cpt2/src/include/protobuf-defs.h | 124 +++
tools/cpt2/src/include/protobuf.h | 8 +
tools/cpt2/src/include/read.h | 13 +
tools/cpt2/src/include/sig.h | 26 +
tools/cpt2/src/include/string.h | 10 +
tools/cpt2/src/include/task.h | 29 +
tools/cpt2/src/include/tty.h | 58 +
tools/cpt2/src/include/types.h | 79 ++
tools/cpt2/src/io.c | 72 ++
tools/cpt2/src/log.c | 39 +
tools/cpt2/src/main.c | 88 ++
tools/cpt2/src/mm.c | 936 ++++++++++++++++
tools/cpt2/src/net.c | 667 +++++++++++
tools/cpt2/src/ns.c | 219 ++++
tools/cpt2/src/obj.c | 270 +++++
tools/cpt2/src/protobuf-defs.c | 103 ++
tools/cpt2/src/protobuf.c | 69 ++
tools/cpt2/src/read.c | 305 ++++++
tools/cpt2/src/res/Makefile | 38 +
tools/cpt2/src/res/vdso-rhel5.so | Bin 0 -> 4704 bytes
tools/cpt2/src/res/vdso-rhel6.so | Bin 0 -> 4528 bytes
tools/cpt2/src/sig.c | 168 +++
tools/cpt2/src/string.c | 33 +
tools/cpt2/src/task.c | 853 +++++++++++++++
tools/cpt2/src/tty.c | 221 ++++
58 files changed, 9160 insertions(+)
create mode 100644 tools/cpt2/Documentation/.gitattributes
create mode 100644 tools/cpt2/Documentation/.gitignore
create mode 100644 tools/cpt2/Documentation/Makefile
create mode 100644 tools/cpt2/Documentation/cpt2.txt
create mode 100644 tools/cpt2/Makefile
create mode 100644 tools/cpt2/README.md
create mode 100644 tools/cpt2/src/Makefile
create mode 100644 tools/cpt2/src/context.c
create mode 100644 tools/cpt2/src/convert.c
create mode 100644 tools/cpt2/src/epoll.c
create mode 100644 tools/cpt2/src/fdset.c
create mode 100644 tools/cpt2/src/files.c
create mode 100644 tools/cpt2/src/fsnotify.c
create mode 100644 tools/cpt2/src/image-defs.c
create mode 100644 tools/cpt2/src/image.c
create mode 100644 tools/cpt2/src/include/context.h
create mode 100644 tools/cpt2/src/include/convert.h
create mode 100644 tools/cpt2/src/include/cpt-image.h
create mode 100644 tools/cpt2/src/include/cpt2.h
create mode 100644 tools/cpt2/src/include/epoll.h
create mode 100644 tools/cpt2/src/include/fdset.h
create mode 100644 tools/cpt2/src/include/files.h
create mode 100644 tools/cpt2/src/include/fsnotify.h
create mode 100644 tools/cpt2/src/include/hashtable.h
create mode 100644 tools/cpt2/src/include/image-defs.h
create mode 100644 tools/cpt2/src/include/image.h
create mode 100644 tools/cpt2/src/include/io.h
create mode 100644 tools/cpt2/src/include/log.h
create mode 100644 tools/cpt2/src/include/magicfs.h
create mode 100644 tools/cpt2/src/include/mm.h
create mode 100644 tools/cpt2/src/include/net.h
create mode 100644 tools/cpt2/src/include/ns.h
create mode 100644 tools/cpt2/src/include/obj.h
create mode 100644 tools/cpt2/src/include/protobuf-defs.h
create mode 100644 tools/cpt2/src/include/protobuf.h
create mode 100644 tools/cpt2/src/include/read.h
create mode 100644 tools/cpt2/src/include/sig.h
create mode 100644 tools/cpt2/src/include/string.h
create mode 100644 tools/cpt2/src/include/task.h
create mode 100644 tools/cpt2/src/include/tty.h
create mode 100644 tools/cpt2/src/include/types.h
create mode 100644 tools/cpt2/src/io.c
create mode 100644 tools/cpt2/src/log.c
create mode 100644 tools/cpt2/src/main.c
create mode 100644 tools/cpt2/src/mm.c
create mode 100644 tools/cpt2/src/net.c
create mode 100644 tools/cpt2/src/ns.c
create mode 100644 tools/cpt2/src/obj.c
create mode 100644 tools/cpt2/src/protobuf-defs.c
create mode 100644 tools/cpt2/src/protobuf.c
create mode 100644 tools/cpt2/src/read.c
create mode 100644 tools/cpt2/src/res/Makefile
create mode 100644 tools/cpt2/src/res/vdso-rhel5.so
create mode 100644 tools/cpt2/src/res/vdso-rhel6.so
create mode 100644 tools/cpt2/src/sig.c
create mode 100644 tools/cpt2/src/string.c
create mode 100644 tools/cpt2/src/task.c
create mode 100644 tools/cpt2/src/tty.c
More information about the CRIU
mailing list