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

199 Commits

Author SHA1 Message Date
Andrey Vagin
6bbdec26f3 files: add ability to set callbacks for files (v7)
Here is nothing interecting. If a file can't be dumped by criu,
plugins are called. If one of plugins knows how to dump the file,
the file entry is marked as need_callback. On restore if we see
this mark, we execute plugins for restoring the file.

v2: Callbacks are called for all files, which are not supported by CRIU.
v3: Call plugins for a file instead of file descriptor. A few file
descriptors can be associated with one file.
v4: A file descriptor is opened in a callback. It's required for
    restoring anon vmas.
v5: Add a separate type for unsupported files
v6: define FD_TYPES__UNSUPP
v7: s/unsupp/ext (external)

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-20 16:07:38 +04:00
Kir Kolyshkin
26fda7a319 space-before-tab whitespace cleanup
Remove space before tab characters.

Found by git grep ' 	' (Space, Ctrl-V, Tab in shell).

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-12 10:00:53 +04:00
Andrey Vagin
d917ff15bb tcp: save the amount of unsent data in the socket send queue
TCP send queue contains two types of data:
* unacknowledged data, which have been sent out
* data, which have not been sent

Currently only the size of all data is save, but it's not enough for
proper restoring of TCP connections.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 17:14:31 +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
4850fd94a8 crtools: move cr_options in a separate header
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 18:17:52 +04:00
Andrey Vagin
1300cf4915 crtools: move all stuff about fdset in a separate header
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 15:24:48 +04:00
Pavel Emelyanov
4e2031ca64 show: Don't print out-of-buffer-range symbols
The print_data helper may access symbols beyond the buffer
range and would thus print trash.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-19 13:30:12 +04:00
Pavel Emelyanov
255d985174 show: Put printing xdigits and symbols in helpers
This is preparation for the next patch.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-19 13:28:40 +04:00
Pavel Emelyanov
360c1c13b2 tcp: Show tcp queues contents when requested
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-19 12:16:07 +04:00
Pavel Emelyanov
008d3a9898 show: Show (lost) mm-*.img image files
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-19 12:03:10 +04:00
Pavel Emelyanov
299dba681c show: Remove excessive includes
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-24 17:50:35 +04:00
Pavel Emelyanov
633e559274 show: Remove dead code
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-24 04:03:31 +04:00
Pavel Emelyanov
b18fb09eb9 show: Replace one-line show_foo calls with args array
We have generic do_pb_show() call and tons of show_foo
routines, that just call one with proper args. Compact
the code by putting the args into array and calling
the do_pb_show() in one place.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-24 04:00:32 +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 Tikhomirov
2752cf9bf7 posix-timer: Add fd, magic and show functionality.
Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:19:24 +04:00
Pavel Tikhomirov
2f98253c26 posix-timer: Add protobuf message and rename to protobuf/timer.proto
Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:19:23 +04:00
Pavel Emelyanov
6bf22f8c75 crtools: Get rid of on-stack cr_options
We have global instance of them, that's enough.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-28 21:11:13 +04:00
Cyrill Gorcunov
a49325b524 protobuf: Prepare scaffolds for procfs NS entries
[ xemul: rename pb.cflag -> pb.ns_cflag ]

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-18 03:37:00 +04:00
Libo Chen
112d7d770e crshow: fix potential fd leak
when pb_read_one_eof faild, we should close fd

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-16 17:07:26 +04:00
Pavel Emelyanov
8e72d96881 show: Use pretty wildcard in pstree and itimers show
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 21:03:13 +04:00
Pavel Emelyanov
2f223fdcf1 show: Clean fdinfo and pstree pretty fmt
Use <field>: format.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 21:03:13 +04:00
Pavel Emelyanov
cd8915202e pagemap: Make show_pagemap use pb_show engine only
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-08 00:44:39 +04:00
Pavel Emelyanov
add21b75c9 show: Remove options args from ->show callback
This thing is global, we can address one explicitly.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-08 00:23:42 +04:00
Pavel Emelyanov
cd537beda5 show: Get rid of flags argument from payload handler
We can "guess" one w/o addirional (obfuscating) argument to
the pb showing engine.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-08 00:00:24 +04:00
Pavel Emelyanov
e48347e095 show: Show nr_pages in pagemap in decimal
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-18 16:29:56 +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
Andrey Vagin
caa1c406fa cr-show: avoid double free for pstree items
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-04 14:00:22 +04:00
Pavel Emelyanov
63270e8d9f show: Show per-task fdinfo in -D/-p output
This info is not in per-ID file, not per-PID, so need special care.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-02 12:09:40 +04:00
Pavel Emelyanov
73d7e283a7 show: Filter -D output with --pid option
Show only image info relevant to given pid. Also reuse
the introduced --pid argument for exec action.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-02 11:58:15 +04:00
Pavel Emelyanov
6241a057b8 show: Beautify -D mode show
Print delimiters and image names for easier reading of the output.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-02 11:30:14 +04:00
Pavel Emelyanov
a0ce796734 show: Fix -D mode showing
Threads' IDs were not initialized on img load.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-02 11:21:47 +04:00
Andrey Vagin
6e528bd1bc crtools: add a callback to show signal=*.img
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-25 23:43:34 +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
Qiang Huang
0de267ccdc crtools: add a callback to show filelocks-%d.img
Add a callback for filelock's image show.

Originally-signed-off-by: Zheng Gu <cengku.gu@huawei.com>
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-17 14:38:40 +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
Alexander Kartashov
b84059a608 multiarch: removed target architecture checks from the following files:
* include/image.h,
* include/syscall-types.h,
* include/restorer.h,
* parasite-syscall.c,
* cr-dump.c,
* cr-show.c,
* pie/parasite.c.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 13:48:07 +04:00
Andrey Vagin
20b5ed916f crtools: put kobj-ids into separate image file (v2)
It is read together with pstree items for checking what kind of
resources should be shared. Core is too big for reading it in
this place.

v2: fix check_core

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-12 00:54:39 +04:00
Pavel Emelyanov
748be83181 cr: Support rlimits
Dump the with "new" prlimit syscall that works on arbitrary pid.

Restore is done in restorer _after_ mappings mixup and _before_
caps drop to make it set any max value.

The RLIM_INFINITY is handled explicitly to help future 64<->32
bits migration.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-10 20:08:38 +04:00
Alexander Kartashov
6f61488f21 x86: moved x86-specific files into the directory arch/x86.
* The following files goes into the directory arch/x86/include/asm unmodified:
  - include/atomic.h,
  - include/linkage.h,
  - include/memcpy_64.h,
  - include/types.h,
  - include/bitops.h,
  - pie/parasite-head-x86-64.S,
  - include/processor-flags.h,
  - include/syscall-x86-64.def.

* Changed include directives in the source files that include the headers
  listed above.

* Modified build scripts to reflect the source moves.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-09 17:02:47 +04:00
Pavel Emelyanov
11f8bb4705 show: Show *-s for zero sequences in hexdump output
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-10 19:19:24 +03:00
Pavel Emelyanov
12602aee59 show: Make hexdump output look like hexdump tool one
No spaces between chars and no 0x-s.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-10 19:00:05 +03:00
Pavel Emelyanov
56e1decf48 show: Factor out skipping of data dump into show_image_data
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-10 18:57:54 +03:00
Pavel Emelyanov
2a925722ca show: Show itimers with std pb showing helper
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-06 16:34:03 +03:00
Huang Qiang
223dce83c2 fix many unclosed file opened by open_image_ro
Many image files opened by open_image_ro weren't closed before return, fix
them all in this patch.

Signed-off-by: Huang Qiang <h.huangqiang@huawei.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-24 16:51:50 +04:00
Cyrill Gorcunov
17a1548a5b pstree: Rename @list member to @sibling
To be close to the kernel naming.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-08 18:59:26 +04:00
Cyrill Gorcunov
a365befaea tty: Add show method
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-09-12 20:00:55 +04:00
Pavel Emelyanov
4dd8d1a98f show: Add pretty output for fdinfo
fd is shown in %d
flags are shown in %#o

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-21 16:30:37 +04:00
Stanislav Kinsbursky
694576723c protobuf: use pretty output for pstree
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-14 14:49:40 +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
c0d83d9e9f show: Add 'hinting' ability
The crtools produces not only dump in its internal format (i.e. -- pb),
but also may call other tools to create files with some state (e.g.
ip tool dumps route and ifaddr info, tmpfs will be tar-ed, iptables
utility will produce the iptables-save file, etc.).

The show functionality cannot read these images, but we can guess what
can be in the file provided by its magic.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-08 15:03:15 +04:00