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

32 Commits

Author SHA1 Message Date
Pavel Emelyanov
ba96e646a4 page-read: Fix naming
The open_page_at one is quite obfuscating.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-18 14:55:22 +04:00
Tikhomirov Pavel
41433f4043 v3 deduplication: add auto-dedup local
Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-18 14:52:04 +04:00
Pavel Emelyanov
c3b9448cf7 pidfile: Don't push opts.pidfile as write_pidfile arg
opts are criu-wide available.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-20 14:26:41 +04:00
Ruslan Kuprieiev
b1a197f0b8 page-server/service: do not chdir / when going daemon
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 21:38:44 +04:00
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
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
07fc6cf394 crtools: don't include image.h in crtools.h
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 15:42:09 +04:00
Ruslan Kuprieiev
4eb2872b27 v2 crtools: write pidfile, when service/page server is run as daemon and "--pidfile" is set
When service/page server becomes daemon, we may need to know it's pid.

Signed-off-by: Ruslan Kuprieiev<kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-16 15:45:01 +04:00
Pavel Emelyanov
7f9302505c page-server: Convert opts.addr into char *
We'll have --address argument reused for library, so make this
abstract address, not ipv4 one.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 12:01:14 +04:00
Andrew Vagin
10343df696 page-xref: set ret to zero if PS_IO_FLUSH completed successfully
Due to this issue the server initiates closing a connection and its
socket is transfered into the TIME_WAIT state, so the second run of
page-server fails with the error "the address is already in use".

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-09 17:57:11 +04:00
Andrey Vagin
d5540a2de5 page-server: check that all data have been accepted
Currently criu sends data to the page server, but it doesn't get any
feedback, so it can't be sure that all data have been accepted.

This patch adds a flush command, which requires an answer from the page
server. This command is sent before disconnecting.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-09 15:39:37 +04:00
Pavel Tikhomirov
9a726d4f9e page-server: Add daemonize call return check
On ubuntu this don't compile if no check.

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-21 19:05:15 +04:00
Andrey Vagin
4f1d2a1005 page-server: allow to execute page-server in the background (v2)
page-server creates a listen socket and only then goes into the
background, so we can be sure, that page-server is ready for work after
detaching.

v2: call daemon() in a proper place and reuse the option -d

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-20 15:00:40 +04:00
Pavel Emelyanov
df79e097ad page-server: Clos last loc xfer on connection close
Currsntly this affects nothing, but xfer close should be called.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-16 17:04:31 +04:00
Pavel Emelyanov
9c14120dd8 page-server: Introduce the OPEN protocol command
If we have empty pagemap, the page server receives no
IO-s for one and doesn't create image file. Intoroduce
the OPEN command to say to page server, that we're about
to xfer and image so it can prepare.

https://bugzilla.openvz.org/show_bug.cgi?id=2584

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-16 16:37:35 +04:00
Pavel Emelyanov
ad4bfe3972 page-server: Fix dst_id encoding
First of all, 4 bits are not enough for type (shmem pagemap's is
28, which is 5 bits). Plus the encode trimmed bits from the id.

https://bugzilla.openvz.org/show_bug.cgi?id=2584

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-16 16:37:33 +04:00
Cyrill Gorcunov
921dbf23de Don't use \Newline in pr_perror
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:44:24 +04:00
Alexander Kartashov
dfaa4542c4 page-xfer: fixed format strings
Use the specifier %lu instead of %zu to print
an unsinged long integer.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-30 18:31:36 +04:00
Pavel Emelyanov
1abb8782a8 page-server: Implement holes writing into pagemap
Just add new protocol command and call local_xfer->write_hole on
server side. Also tune the mem-snap test to test memory xfer via
page server.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-18 17:34:47 +04:00
Andrey Vagin
ae99f53928 page-xfer: close sockets on errror paths
CID 996195 (#1 of 1): Resource leak (RESOURCE_LEAK)
10. leaked_handle: Handle variable ask going out of scope leaks the handle.

CID 996196 (#3 of 3): Resource leak (RESOURCE_LEAK)
10. leaked_handle: Handle variable sk going out of scope leaks the handle.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-16 21:58:29 +04:00
Pavel Emelyanov
7f146f1337 poage-xfer: Cleanup xfer logging
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-16 12:16:56 +04:00
Pavel Emelyanov
485cbda195 page-xfer: Sanitize opening page xfer
Make it be explicitly splitted into 2 sub-paths.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-16 12:10:39 +04:00
Pavel Emelyanov
8f9dd8f76c page-server: Make open_page_server_xfer static
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-16 12:09:16 +04:00
Pavel Emelyanov
37c37416ac page-server: Use new page-xfer API to write pages locally
Page server cannot provide one big pipe with pages. Thus,
before this patch, it wrote pages into image in small pieces.
Now the page-xfer API accepts pagemaps and pages separately,
so we can just use thie API.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-16 12:02:39 +04:00
Pavel Emelyanov
1e78c91d20 page-xfer: Fix page writing API
Split it into two parts -- writing pagemap and writing
pages. This is required for page-server part, sinc it
cannot provide one big pipe with all the pages at once.
Thus it needs to feed pages in portions.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-16 11:59:19 +04:00
Pavel Emelyanov
433c46625e dump: Snapshot memory
It's quite simple -- get parent's pagemap before dumping memory,
then collect _full_ pagemap of task putting holes into page-pipe
when the page is (soft-dirty-clear && in-parent-map). At the end
reset task's soft-dirty bits.

This requires kernel support from
http://comments.gmane.org/gmane.linux.kernel.mm/98283

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-12 19:45:18 +04:00
Pavel Emelyanov
eb5a378855 page-xfer: Write holes and non-holes in sorted way
The pagemap.img contains sorted iovs. Need to keep this array also
sorted even if holes are in there for simpler read on restore.

Separate ->write_hole callback since dump of hole and non-hole
will differ significantly.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-12 19:45:10 +04:00
Alexander Kartashov
2ce60f1dbc page-xfer.c: fixed format strings
This patch generalizes format strings in the file page-xfer.c
to prevent format string warnings on ARM.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-18 22:31:45 +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
d36480ed05 mem: Raise the page images IDs base for page server
Currently shmem generates page images in parallel
with page server and IDs may intersect. Fix this by
making page server create larger IDs.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-14 18:28:38 +04:00
Pavel Emelyanov
213faeae6d mem: Introduce page server
The page server is a process, that is about to get pages over
the network and put them into pagemap- + pages- images. Right
now what it does is simply get the data and puts it into the
image files. When we have dirty set tracking in the kernel the
page server will have to collect "page changes" and properly
integrate them into images.

Running crtools with page server is like this:

dst_node# crtools page-server --port <port> -D dump/ ...
src_node# crtools dump -t <pid> --page-server --address <dst_node> --port <port> -D dump/ ...

After this images from dst_node/dump/ and src_node/dump/ should
be put into one place and tasks can be restored out of it.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-14 18:16:44 +04:00
Pavel Emelyanov
02fc86958e mem: Abstraction layer for putting pages into image
We'll send them over network soon, so prepare abstraction layer for
this. Shmem is not on this scheme yet.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-14 18:16:43 +04:00