For example
| Error (protobuf.c:574): Unexpected EOF on /home/crtools/tools/cpt2/test/out/utsns-1.img
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
"Can't fixup VMA's fd" is more understandable than plain
"Can't fixup fd".
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
If a master point has sid, it doesn't mean, that all slave points
will have sid. Look at tty03 for example:
PID SID TT COMMAND
26748 26748 ? tty03
26749 26749 pts/2 \_ tty03
26750 26750 ? \_ tty03
The second process has not a file descriptor for the ctl tty,
but this tty is opened in tty03.
v2: If a slave point with sid has not a master point, the option
--shell-job must be set and sid isn't restored for such terminals.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
PID SID TT COMMAND
26748 26748 ? tty03
26749 26749 pts/2 \_ tty03
26750 26750 ? \_ tty03
The second process has not a file descriptor for the ctl tty,
but this tty is opened in tty03.
Currently CRIU can not restore this test case correctly.
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The system call open can add O_LARGEFILE.
A point is reopend for unsharing a file descriptor. So here are two
types of points. One is returned by pipe() and all other ones are
got via opening /proc/PID/fd.
Currently I know only one difference between these types, it's
O_LARGEFILE.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Tested-by: Alexander Kartashov <alekskartashov@parallels.com
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Use decode_pointer() to convert a virtual address into a native pointer.
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Otherwise we will get nil dereference in shared_fdt_prepare
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Here is updated one.
0001-ids-Make-sure-kIDs-is-present-in-image.patch
>From dee67b483f0ed1a6f81ebe95ae9bdf74d3ab2ad7 Mon Sep 17 00:00:00 2001
From: Cyrill Gorcunov <gorcunov@openvz.org>
Date: Fri, 15 Mar 2013 00:43:30 +0400
Subject: [PATCH 1/2] ids: Make sure kIDs is present in image
Otherwise yield error instead of nil dereference
if we meet a broken image.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This mode was introduced less than year ago:
commit 9883035ae7edef3ec62ad215611cb8e17d6a1a5d
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Sun Apr 29 13:12:42 2012 -0700
pipes: add a "packetized pipe" mode for writing
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mnt_entry::fstype is a part of image ABI, thus we need
to provide some "common" encoding outside tools would
know about this field encoding.
Thus we instorduce fstype enum in .proto file and use it
in source code as well.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
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>
Actually rt_sigset_t and k_rtsigset_t are the same
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Otherwise ppage_bitmap and page_bitmap will be updated for wrong VMA
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
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>
Need to have proper fake-item state to make this code work ok:
get_task_ids
if (item->state != TASK_DEAD) {
ret = dump_task_kobj_ids(item);
if (ret)
goto err_free;
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
In Fedora /var/run is on tmpfs, so all directories should be
recreated each times.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
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>
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>
Generate random data only for buffers with sizes less than FAST_SIZE
If a size of buffer is more that FAST_SIZE, the first FAST_SIZE bytes
are filled by random generator and then this chunk is used as pattern
for all other chunks.
With out this patch:
$ time bash -x test/zdtm.sh static/maps04
real 0m16.777s
user 0m0.054s
sys 0m0.724s
With this patch:
$ time bash -x test/zdtm.sh static/maps04
real 0m1.865s
user 0m0.128s
sys 0m0.745s
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
A signal can be handled by non-leader thread and sigsuspend
will not be woken up.
kill can send signals to a specified thread, so a futex is used for
synchronization.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This allows to reuse magic numbers outside of crtools code.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The ARM parasite head uses a pad of 228 bytes
to make the offset of the symbol __export_parasite_stack
representable in the ARM instruction set. This value
needs to be changed every time the value of the macro
PARASITE_STACK_SIZE changes.
This patch makes this manual interference redundant.
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Currently we dump pages directly from parasite into image files. This
is bad for several reasons:
1. We cannot use any more-or-less custom format for pages easily, since
parasite code cannot be linked with any libraries;
2. We will not be able to optimize migration with preliminary memory
migration (a.k.a. iterative migration) with it -- if we send pages
from parasite over network we are not able to let the task we dump
continue running.
That said, what is done is -- pages from target task are put into a
page-pipe in one go, then (not in this patch) parasite can be released
and we can do with pages whatever we want. For now pages are just
spliced from pipe into image file.
Some numbers:
In order to drain 1Gb of memory from task we need 1.5M of shared map
in args (for iovecs) and 4 pipes (8 descriptors) each referencing 128Mb
of pages, which int turn requires 4 x 640K chunks of sequential kernel
memory (for pipe_buffer). Not that big I guess.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>