2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00
Commit Graph

1856 Commits

Author SHA1 Message Date
Cyrill Gorcunov
9d0875a813 files-reg: Use close_safe for fd variable
This makes compiler happy.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-31 14:09:49 +04:00
Cyrill Gorcunov
ba85bf30bd sk-inet: Init addr_size variable
Since we've BUG_ON(1) here so this is
not a problem, but lets make compiler happy.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-31 14:09:39 +04:00
Cyrill Gorcunov
bcb625b8af parasite: Init ret variable
Compiler doesn't like the ret unitialized
here (it's not a problem since SIGMAX is
never less than 1).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-31 14:09:32 +04:00
Cyrill Gorcunov
8a3e7f31f4 log: Introduce LOG_PREFIX
Useful if one need a prefix over module messages.
I use it in tty c/r, thus having something like

 | TTY: master 0x31 index 2 fd 6 pid 5079 (create 1)
 | TTY:     `- slave 0x5c index 2 fd 255 pid 5080 (create 0 send 0)
 | TTY: standalone slave 0x2e index 1 fd 3 pid 5079 (create 1)

in log. Which helps filtering messages.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-31 14:07:09 +04:00
vkonyashkin
d1a36cc98a zdtm: It's need turn off FORTIFY_SOURCE instead of use -Wno-unused-result option
The -Wno-unused-result option looks to have been introduced in GCC 4.5.0.
So it's need turn off FORTIFY_SOURCE (compiler warn about unused results
in fortification mode) instead of use -Wno-unused-result to avoid error
in versions prior to 4.5.0.

Signed-off-by: Victor Konyashkin  <vkonyashkin@parallels.com>
Acked-by: Andrey Wagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-31 14:06:04 +04:00
vkonyashkin
47d200c637 zdtm: It's need to sleep between clock_gettime() in uptime_grow
Kernel can't suspend container by design if calls clock_gettime()
in a loop, so we need to sleep between clock_gettime().

Signed-off-by: Victor Konyashkin  <vkonyashkin@parallels.com>
Acked-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-31 14:05:43 +04:00
Pavel Emelyanov
4ee52f3403 tcp: Use sk ino number for opening tcp stream image on restore
It was accidentally broken by 424a4adb6. It's better to use sk ino
instead of sk id, since tcp connection may be unbound from any fds
(not supported now) and thus there may be no ID for those.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-31 13:57:44 +04:00
Pavel Emelyanov
56a7073e83 Add the CREDITS file
This is a file with ... credits, yes :) While implementing the C/R stuff
we've receive a LOT of help from various people and would like to mention
them. If we've undeservedly forgotten someone (or something) -- please
help us to make amends and send a patch to this file.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-30 13:52:37 +04:00
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