2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-28 12:57:57 +00:00

31 Commits

Author SHA1 Message Date
Cyrill Gorcunov
8f64a14a03 headers: Move fcntl related data to include/fcntl.h
fcntl data is arch independent, so move it out of include/asm/type.h

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 22:13:10 +04:00
Andrey Vagin
a434e7f075 crtools: move pid_rst_prio to pid.h
crtools.h is too heavy to be included in many sources

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 18:18:12 +04:00
Andrey Vagin
0d1dfc2e08 crtools: move all stuff about vma together
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 12:43:49 +04:00
Andrey Vagin
924acd8450 shmem: don't include restorer.h in shmem.c
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 12:38:43 +04:00
Pavel Emelyanov
45f39e0415 rst: Make shmem restore to use rst-malloc
This actually fixes a bug -- memory for shmem info was
not allocated dynamically, thus we were limited in the
amount of shmems to be restored.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-02 01:06:31 +04:00
Pavel Emelyanov
7a16734ed5 rst: Formalize the shared resource restore order
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-29 08:07:15 +04:00
Pavel Emelyanov
84737e2796 build: Generate most of the pb-desc automatically
These contain linkage between number, data type and routines
for pb messages we write/read to/from image files. Most of them
have simple number-type-routines mapping, so introduce a generating
script for that.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-23 21:47:31 +04:00
Pavel Emelyanov
f4e36cc5d0 shmem: Print shmem ID on dump in decimal
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-16 16:20:17 +04:00
Cyrill Gorcunov
5a61a50939 shmem: Add missing \Newline into pr_info
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-16 21:52:15 +04:00
Cyrill Gorcunov
67e91d65a1 shmem: restore_shmem_content -- Use close_safe
Don't call close() with degative fd. For consistency
simply use close_safe here. All fds touched are initialized
either to valid fd or to value < 0 which pretty good handled
by close_safe helper.

CID 996212 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
10. negative_returns: "fd" is passed to a parameter that cannot be negative.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-12 20:50:35 +04:00
Pavel Emelyanov
5cae819d8c img: Get rid of open_image_ro helper
O_RSTR flag should be used instead for regular open_image

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-09 19:22:21 +04:00
Pavel Emelyanov
421d46f79e pages: Accept pages images from versions v0.4 and below
After reworkring the way pagemap is stored the backward compatibility
was not preserved for patches simplicity. Time to return it back.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-27 13:12:02 +04:00
Pavel Emelyanov
cc3a3c475b dump: Fix one-page mapping dump
The iov array for 1-page mapping would be zero. Fix this silly mistake.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-15 18:23:19 +04:00
Pavel Emelyanov
39402af71a page-xfer: Simplify one page-pipe dumping
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-15 18:23:19 +04:00
Pavel Emelyanov
4074a87637 shmem: Rework dumping code to use page-pipe and -xfer engines
This makes it easier to merge with anon vmas dumping and makes use of
page server for shared memory.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-15 18:23:19 +04:00
Pavel Emelyanov
6c83c24242 shmem: Simplify error paths
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-15 18:23:19 +04:00
Pavel Emelyanov
94c6d77340 shmem: Split shmem dumping code into two
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-15 18:23:19 +04:00
Pavel Emelyanov
8801f59615 mem: Protobuf format for page dumps
Since now we drain pages out of parasite, we can invent any format for
page dumps. Let is be ... prorobuf one! :)

Another thing to keep in mind, is that we're about to use splices and
implement iterative migration, so it's better to have actual pages be
page-aligned in the image.

And -- backward compatibility. That said the new format is:

1. pagemap-... file which contains a header (currently with a ID of
   the image with pages, see below) and an array of <nr_pages:vaddr>
   pairs. The first value means "how many pages to take from the
   file with pages (see below)" and the second -- where in the task
   address space to put them. Simple.

2. pages-... file which containes only pages one by one (thus aligned
   as we want).

This patch breaks backward compatibility (old images with pages wil
be restored and then crash). Need to do it before v0.5 release.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-14 18:16:41 +04:00
Alexander Kartashov
3c16edc0bd cr: generalized format strings
This patch replaces the format specifier %ld with PRIx64
in the following places:

* the format string argument of the functions scanf() and printf(),
* in the macros GEN_SYSCTL_*_FUNC.

We need explicit specification of the integer size there.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-16 19:20:08 +04:00
Pavel Emelyanov
969ca6d9bf shmem: Get rid of static array of dumped shmem areas
These are used by single process, no need in keeping them in
such a strange way. Plus, turn this array into a hash table
for better search.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-17 00:20:58 +04:00
Pavel Emelyanov
64149b40f2 code: A little but more checkpatch fixes over code
There are more in test/ (and checkpatch.pl crashes in the middle =),
but seem to be all.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-11 22:19:34 +04:00
Pavel Emelyanov
a1b731dac3 code: Brush up multi-line comments first line
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-11 21:48:17 +04:00
Pavel Emelyanov
b1b0a39a58 pb: Rewrite object reading to use pb-descs
The pb_read thing is no longer a macros. This will allow to
factor out objects collecting on restore.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-07 19:22:00 +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
Cyrill Gorcunov
582954685b Escape using unsafe sprintf helper
Util it's very critical for speed we should
not use unsafe sprintf helper, we're root-granted
program and must be as safe as possible.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-20 15:04:51 +04:00
Andrey Vagin
bdfb0d80fa shmem: used open_proc_rw to open proc files
open_proc_rw knows that proc may be mounted not in /proc,
it's used for restoring tasks in pid ns.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-19 22:17:24 +04:00
Stanislav Kinsbursky
41195598cf parasite: remove excessive header deps from parasite.h and friends
The task is not complete - this is just a part of what have to be done. I.e.
looks like a lot of excessive deps can be fixed.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-30 12:50:18 +04:00
Andrey Vagin
066ec066a0 crtools: remove unused variables (v3)
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-18 19:01:21 +04:00
Andrey Vagin
f0decea728 log: remove pid from messages
Now log messages may be splitted by pid

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-04 16:24:20 +04:00
Pavel Emelyanov
26a53837f9 shmem: Move shmem dumping code to shmem.c
This is also a code move plus two changes:

* shmems renamed to dump_shmems
* shmem area size is shared with restorer (it's one page for both for now)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-03 18:07:01 +04:00
Pavel Emelyanov
bc75b0f253 shmem: Move shmem restoring code to shmem.c
No changes, just code move (and rename of shmems variable).

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-03 18:01:05 +04:00