2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 05:18:00 +00:00

1830 Commits

Author SHA1 Message Date
Kinsbursky Stanislav
cb6ae5b6c9 protobuf: use pb-vertical show function for mm
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:30:35 +04:00
Kinsbursky Stanislav
b49ee4cb5b protobuf: use pb-vertical show function for uts namespace
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:30:20 +04:00
Kinsbursky Stanislav
bc04724a2c protobuf: use pb-vertical show function for creds
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:30:09 +04:00
Kinsbursky Stanislav
da4d808af8 protobuf: use pb-vertical show function for fs
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:29:55 +04:00
Kinsbursky Stanislav
caea044a8b protobuf: use pb-vertical show function for ghost file
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:29:40 +04:00
Kinsbursky Stanislav
5bb1b8428b protobuf: replace rectangular bracket by curly one for nested messages show
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:28:17 +04:00
Kinsbursky Stanislav
b56bc8c5f9 protobuf: added support for optional fields
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:28:15 +04:00
Kinsbursky Stanislav
01228a195a protobuf: added nested messages outup shift for vertical output
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:28:15 +04:00
Kinsbursky Stanislav
705411f4bc protobuf: vertical output support introduced
Will be used for single-entry images.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:28:14 +04:00
Kinsbursky Stanislav
5809e7d0b3 protobuf: control block for generic show introduced
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:28:12 +04:00
Cyrill Gorcunov
df81acafa7 restorer: Calculate self-stack size with guard pages
Otherwise we might not unmap the whole stack leaving
a guard page in restoree memory map. Not a big deal
but anyway.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-24 14:06:30 +04:00
Pavel Emelyanov
95c593a618 inotify: Sanitize inotify + inotify_wd collecting
Add fdesc at once, don't init list we're about to add
and use single fd variable.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-24 10:22:37 +04:00
Pavel Emelyanov
2b2a40a20d eventpoll: Don't allocate Entry on collect stage
The PB read engine will do it for us.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-24 10:22:35 +04:00
Pavel Emelyanov
630d1741c2 criu: Version 0.1 release
This is the first release of the tool! :)

Supported features:

* x86_64 architecture
* process' linkage
* process groups and sessions (without ttys though :\ )
* memory mappings of any kind (shared, file, etc.)
* threads
* open files (shared between tasks and partially opened-and-unlinked)
* pipes and fifos with data
* unix sockets with packet queues contents
* TCP and UDP sockets (TCP connections support exists, but needs polishing)
* inotifies, eventpoll and eventfd
* tasks' sigactions setup, credentials and itimers
* IPC, mount and PID namespaces

Most of the above works with kernel v3.5!

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
v0.1
2012-07-23 09:37:53 +04:00
Cyrill Gorcunov
2f3727f0e2 docs: Add EXAMPLES section
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-23 07:09:39 +04:00
Cyrill Gorcunov
148273d098 docs: Shrink synopsis
All options are described below, only main arguments
should be there.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-23 07:09:31 +04:00
Cyrill Gorcunov
f34cd5fd94 help: Drop -p option
We don't have it anymore

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-23 07:09:22 +04:00
Cyrill Gorcunov
b4a4ba7ac9 docs: Add long and some new options
To reflect current options we support

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-23 07:08:48 +04:00
Cyrill Gorcunov
e6167b5aa6 make: Disable stack executable bit
Otherwise crtools built with stack executable, in result
kernel sets up

	current->personality |= READ_IMPLIES_EXEC;

when our crtools get loaded into memory and mmap
calls in restorer create VMAs with EXEC bit set.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-20 19:39:25 +04:00
Cyrill Gorcunov
b0ea7a1a6b restorer: Drop commented out code
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-23 07:01:13 +04:00
Cyrill Gorcunov
58b0ef655f restore: Add test for optional PB fields in core_entry
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-07-20 14:30:20 +04:00
Pavel Emelyanov
5421e44b72 show: Don't crash if thread_info is absent in core
This is how zombies live.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-20 14:13:14 +04:00
Cyrill Gorcunov
9d918c5964 protobuf: Convert core_entry to PB format v5
This requires some exlanations

 - Since we use protobuf data in restorer
   code we need to carry a copy of appropriate
   PB entities in resident memory. For this
   sake task_restore_core_args and thread_restore_args
   were significantly reworked. In short -- the caller
   code fills PB structures into task arguments space.

v3:
 - Combine everything arch related to thread_info field,
   and make it optional
 - Drop "version" field from message, we check version in
   another specific message
 - Don't forget to call core_entry__free_unpacked where needed
 - We continue dumping FPU state, still it's not yet restored

v4:
 - Don't carry task_core_entry and task_kobs_ids_entry for
   threads, and yield error if present in image.

v5:
 - Allocate core_entry depending on type of task being dumped

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-20 14:06:42 +04:00
Pavel Emelyanov
092ae8c999 log: Remove message saying the log level set
Was added for debugging. Spoils the "show" output.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-20 13:44:30 +04:00
Andrey Vagin
bed6c34b17 socket: skip unsupported sockets
Before this patch, it stopped if stat() failed.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-20 09:46:15 +04:00
Pavel Emelyanov
64967eef21 crtools: Kill the ability to work on individual process
We haven't tested it for several monthes and there's no evidence
it is required at all. For dumping a single task -t option works
just fine.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 17:55:34 +04:00
Pavel Emelyanov
9f2168a4f0 images: Introduce the top-level file -- inventory
Currently we store the images version in the core file. This is
bad, since core file describes a single process (or thread) and
says nothing about the images set as a whole (let alone the fact
that it's being parsed too late).

Thus introduce the inventory image file which describes the image
set the way we need (want). For now the only entry in it is the
images version. In the future it can be extended.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 17:37:25 +04:00
Pavel Emelyanov
76e7f12cb8 log: Fix loglevel assignment
For some reason the optind was misused (maybe I broke it with prev patch)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 17:25:04 +04:00
Pavel Emelyanov
0b76ba375e crtools: Add version constans and cmdline option
Set it to 0.0 since we haven't done any releases yet.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 16:51:58 +04:00
Pavel Emelyanov
dd16fec48c crtools: Sanitize options parsing
Do not presume that the argv[1] is action. Use the optind index at the end
of parsing instead. This allows to specify --help option properly.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 16:50:04 +04:00
Stanislav Kinsbursky
af3b2869b3 show: cleanup
remap_id_type() is not used.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 14:56:01 +04:00
Stanislav Kinsbursky
37dd509fae protobuf: rename default make target from "all" to "protobuf"
Otherwise it look strange when nothing to compile and make says that target
"all" doesn't require to be rebuild.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 14:55:08 +04:00
Stanislav Kinsbursky
92e6a30904 protobuf: simplify plain show logic
__pb_show_msg() is redundant.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 14:54:27 +04:00
Pavel Emelyanov
0c54b67b88 pb: Switch uts namespace image file to protobuf format
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 14:52:30 +04:00
Cyrill Gorcunov
4806e1395f protobuf: Convert vma_entry to PB format v3
v2:
 - Use regular uint types in message proto
 - Use PB engine for "show"
v3:
 - drop usage of temp. variable in prepare_shmem_pid

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 12:43:36 +04:00
Pavel Emelyanov
ffd40996ea pb: Switch creds to protobuf format
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 12:35:25 +04:00
Cyrill Gorcunov
afea21f954 protobuf: Convert IPC entries to PB format v2
v2 (from skinsbursky@)
 - drop redundant header inclusion
 - drop redundant "goto out"
 - drop redundant NULL assignment

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 11:31:39 +04:00
Pavel Emelyanov
9fc1d6bbeb fdinfo: Make fdinfo.type be an enum
This types specifies a strict set of what is hidden behind
the fd. Thus these numbers should be in the description of
the fdinfo message.

Plus protobuf makes shure nothing else will be there.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 10:18:37 +04:00
Pavel Emelyanov
dffd0aa65f protobuf: Introduce enum showing function
Try hard to find the symbolic (declared in .proto file) name
for the given value.

Will use enums in fdinfo, thus prepare.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 10:17:40 +04:00
Cyrill Gorcunov
0cf04ac781 protobuf: Drop old sk_opts_entry structure
We've switched to SkOptsEntry, no need to carry this
obsolete one.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 09:44:41 +04:00
Cyrill Gorcunov
043cfc99b1 dump: Drop FD_DESC_INVALID redundant assignment
It's assigned by FD_PARMS_INIT already.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 09:40:13 +04:00
Cyrill Gorcunov
0468355c12 protobuf: Drop fown_t type
We are ready to use FownEntry everywhere,
so drop fown_t type and clean up source code.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 09:39:00 +04:00
Cyrill Gorcunov
8d92c2c3b2 protobuf: Convert inet sockets to PB engine
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 09:33:33 +04:00
Cyrill Gorcunov
c9ea79db93 protobuf: Convert unix_sk_entry to PB engine v3
v2:
 - Use alloc_socket_opts/free_socket_opts helpers
 - Use pb_prep_fown helper
v3:
 - Add missing ui->name = NULL

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 09:32:55 +04:00
Cyrill Gorcunov
eb0f81bc6f protobuf: Convert sk_opts_entry to PB format
This patch prepares the ground for further patches.
sk_opts_entry get converted to PB format but not
yet used anywhere in code. Also a few additional
pb_ helpers are added.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 09:31:00 +04:00
Pavel Emelyanov
2383c398c4 pb: Switch sigactions showing to use pb_show_plain
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-18 19:22:06 +04:00
Pavel Emelyanov
d6514dae45 pb: Introduce show_plain routine
This one walks the 'plain' image file, i.e. the one with straignt <magi>[<size><entry>]*
format, and prints each message. Saves lots of lines of code.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-18 19:09:51 +04:00
Pavel Emelyanov
9de8295ba7 pb: Clean _TYPECHECK name generation
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-18 18:57:33 +04:00
Pavel Emelyanov
a710f61717 pb: Clean pb callback pointers typedefs
Use more classical version with asterisk in type definition

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-18 18:42:35 +04:00
Stanislav Kinsbursky
656a463769 show: Convert simple array showing fns to use pb_show_msg
[merges some Stas' patches]

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 08:26:25 +04:00