2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 01:51:51 +00:00

1648 Commits

Author SHA1 Message Date
Cyrill Gorcunov
26aa295135 files: Enhance error message
While being debugging problem I found plain BUG_ON is not enough.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-28 09:11:12 +04:00
Kinsbursky Stanislav
33293222ba protobuf: set field size to proper value fro "ENUM" type
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-28 09:10:17 +04:00
Kinsbursky Stanislav
6243e9c0cb crtools: remove references to absent '-p' option
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-28 09:09:52 +04:00
Kinsbursky Stanislav
2249fb3c91 crtools: check optind is valid before parsing command argument
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-28 09:08:46 +04:00
Kinsbursky Stanislav
797f9cc019 makefile: remove all references to "test-legacy"
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-28 09:08:16 +04:00
Kinsbursky Stanislav
d88a52f1a1 protobuf: use generic show function for processes tree
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-28 09:07:27 +04:00
Kinsbursky Stanislav
8c72187be1 protobuf: use generic show function for ipc namespace variables
v2:
1) Debug garbage removed

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-28 09:05:07 +04:00
Kinsbursky Stanislav
ba4366d3da protobuf: use generic show function for ipc shared memory
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-28 09:04:58 +04:00
Kinsbursky Stanislav
49ea3128db protobuf: use generic show function for ipc messages
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-28 09:04:51 +04:00
Kinsbursky Stanislav
26eb254f96 protobuf: use generic show function for ipc semaphores
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-28 09:04:41 +04:00
Kinsbursky Stanislav
290003e964 protobuf: add payload print support in generic show function
This patch also updates pipe data and sockets queues payload handlers to
output data in "-c" option was passed to crtools.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-28 09:02:38 +04:00
Cyrill Gorcunov
737045fe57 test: Drop legacy directory
All things are already in zdtm, not need to carry it.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:59:05 +04:00
Cyrill Gorcunov
e77c21f725 crtools: Drop tools directory
I've been using it to send notifications about
commits but there is no need anymore.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:58:24 +04:00
Kinsbursky Stanislav
bdb58423ca protobuf: use generic show function for pipe data
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:33:29 +04:00
Kinsbursky Stanislav
9ac6d09149 protobuf: use generic show function for socket queues
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:33:20 +04:00
Kinsbursky Stanislav
63ad6e6d30 show: add helper for reading and printing of images binary data
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:33:04 +04:00
Kinsbursky Stanislav
d0a5f0aea9 protobuf: add show support for images payload
Payload handler can be passed into generic protobuf show function.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:32:41 +04:00
Kinsbursky Stanislav
ae150da091 protobuf: use pb-vertical show function for core
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:30:50 +04:00
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