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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>