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

9635 Commits

Author SHA1 Message Date
Michael Holzheu
602a948ddd s390: Enable travis
We have to use "debian.jessie" instead of "ubuntu.xenial" because
qemu-s390x-static can only run z900 instructions and Ubuntu is
built with a more recent architecture level set.

We first enable only gcc because there are still some issues with clang.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Michael Holzheu
9c94ed9669 s390/zdtm: Also support z900 (debian)
Debian is compiled for z900 - therefore we can't use the "laa"
instruction.

Fix this and replace "laa" by the older "cs" (compare and swap) loop.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Michael Holzheu
a04dc883cb s390: Replace flogr instruction with __builtin_clzl()
The flogr instruction not supported by debian jessie (z900).
So replace it by the gcc built-in.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Michael Holzheu
254094d66f s390: Prevent GOT relocations
Use the "-fno-optimize-sibling-calls" gcc option to prevent GOT relocations
caused by gcc versions without the commit "S/390: Fix 64 bit sibcall":

 * https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=233169

Otherwise we get compile errors like:

 GEN      criu/pie/parasite-blob.h
 Error (compel/src/lib/handle-elf-host.c:572):
 Unsupported relocation of type 26

Those can be caused by the following relocation types:

 * R_390_GOTENT (e.g. RHEL7 based systems)
 * R_390_GOTPCDBL (e.g. Debian Jessie)
 * R_390_GOT12 (e.g. Debian Jessie)

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Michael Holzheu
6603b419c7 s390:criu: Add TASK_SIZE check for dump and restore
For kernels that don't have commit ee71d16d22 ("s390/mm: make TASK_SIZE
independent from the number of page table levels") criu sets TASK_SIZE
to 4 TB on s390 (see compel_task_size()).

When dumping tasks >= 4 TB on such systems, we would silently loose
memory >= 4TB.

So add a check and refuse to dump the task in that case.

When restoring tasks >= 4 TB on such systems, the remap() call for
moving the vmas at the end of the restor process would fail
and a very unclear error message is printed.

So add a check and write a more speaking error message in that case.

Reviewed-by: Alice Frosi <alice@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Michael Holzheu
c2f30337a5 s390:criu: Add support for s390 consoles
On s390 we have special console drivers with minors 64 and 65.
Add support for them in criu code and in zdtm testsuite.

Reviewed-by: Alice Frosi <alice@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Michael Holzheu
27db1d9a04 s390:zdtm: Add test for tasks > 4TB
If the kernel contains patch ee71d16d22 ("s390/mm: make TASK_SIZE
independent from the number of page table levels") we are able
to checkpoint tasks > 4TB.

Add a testcase to verify this.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Michael Holzheu
2ced0450b2 s390: Enable s390 build in Makefile
Reviewed-by: Alice Frosi <alice@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Michael Holzheu
01ee29702e s390:zdtm: Enable zdtm for s390
Reviewed-by: Alice Frosi <alice@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Michael Holzheu
500977101e s390:criu: Enable s390 in criu
Add s390 parts to common code files.

Patch history
-------------
v2->v3:

 * Add: Fix big endian byte order checks

Reviewed-by: Alice Frosi <alice@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Michael Holzheu
dc927a20c5 s390:criu/arch/s390: Add s390 parts to criu
Reviewed-by: Alice Frosi <alice@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Michael Holzheu
343b5f53ef s390:proto: Add s390 to protocol buffer files
Reviewed-by: Alice Frosi <alice@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Michael Holzheu
8b23923640 s390:compel: Enable s390 in compel/
Add s390 parts to common code files.

Patch history
-------------
v2->v3:

 * Add: s390: Consolidate -msoft-float into Makefile.compel

Reviewed-by: Alice Frosi <alice@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Michael Holzheu
7ce8f56be2 s390:compel/arch/s390: Add architecture support to compel tool and libraries
This patch only adds the support but does not enable it for building.

Reviewed-by: Alice Frosi <alice@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Pavel Emelyanov
49d8cd0977 tty: Move tty into files image
This completes merging files images into one.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Pavel Emelyanov
a35d378562 tty: Set active-pairs bit once
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Pavel Emelyanov
ce3e40eef4 tty: Verify info once
Same here -- now when we collect info and driver at the same
place late enough we can verify info once, then attach to
files.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Pavel Emelyanov
c93edee2cb tty: Get driver for info once
Since we need tty driver for info, we may lookup the guy
when collecting info, not when attaching it to a file.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Pavel Emelyanov
081a312604 tty: Change the order of collection
There are two object for TTY files -- the file itself and tty_info.
The latter is effectively an inode image. Right now we collect infos
before files, so that latter can find former and attach to it.

In order to move tty files on generic file entry we need to collect
files very early, much earlier, that infos. So here's the patch that
changes the order of tty file vs info collection.

The general idea is -- when collecting files put them in a list and
when an info arrives it walks that list and attaches ttys to self.
Next patches will also add some optimization available with that
scheme.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Pavel Emelyanov
bb825d89c8 files: Move pipes into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Pavel Emelyanov
8c70b99dc6 files: Move fifo into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +03:00
Pavel Emelyanov
fd39196d98 files: Move unix sk into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:40 +03:00
Pavel Emelyanov
257e2e6023 files: Move ext files into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:40 +03:00
Pavel Emelyanov
033d9e208a files: Move fanotify into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:40 +03:00
Pavel Emelyanov
fdf4b22a3e files: Move inotify into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:40 +03:00
Pavel Emelyanov
24771da93d files: Move timerfd into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:40 +03:00
Pavel Emelyanov
5579d74c15 files: Move tunfile into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:40 +03:00
Pavel Emelyanov
1b6144368a files: Move signalfd into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:40 +03:00
Pavel Emelyanov
fe0b08ef4f files: Move epoll into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:40 +03:00
Pavel Emelyanov
8208e5a5ab files: Move eventfd into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:40 +03:00
Pavel Emelyanov
341961beb0 files: Move netlink sock into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:40 +03:00
Pavel Emelyanov
52bf8c4a83 files: Move packet sock into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:40 +03:00
Pavel Emelyanov
1564dd4ec7 files: Move ns files into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:40 +03:00
Pavel Emelyanov
55519df9f1 files: Move inet sockets into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:40 +03:00
Pavel Emelyanov
bee9eacad4 files: Move reg files into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:40 +03:00
Pavel Emelyanov
fe6fa3bec3 image: Introduce files.img and file_entry
There are two goals of this merge. First is to reduce the amount
of image files we generate and scan on restore. The latter is
more importaint, as even if we have no weird stuff like signalfd,
we still try to open this file. So after the merge we try to
open ~15 image files (out of ~30) less %) which is nice.

The 2nd goal is to simplify the C/R support for SCM messages.
This becomes possible with the fact, that all files we have can
be distinguished by their ID only, w/o type. This, in turn,
makes image layout for SCMs much simpler.

Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:39 +03:00
Pavel Emelyanov
904e7b383b file: Introduce prepare_files()
I'm about to merge all the file images into one big image,
so here's the place that would read it and collect.

Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:39 +03:00
Pavel Emelyanov
b7b3b19f7e pb: Add a helper to collect single entry
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:39 +03:00
Pavel Emelyanov
41df032e12 Merge pull request #373 from ISilence/master
Update README.md
2017-08-09 13:45:21 +03:00
Pavel Begunkov
447312cf58
docs: Fix errata in README.md
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
2017-08-09 10:10:42 +03:00
Pavel Emelyanov
43d4a83511 Update README.md
(Try to) Fix the readme problems found by the feedmereadmes guys:

* Tuned up the tagline
* Added info about what for, history, competitors, etc.
* Put more links for potential contributors
2017-08-08 15:59:00 +03:00
Pavel Emelyanov
43ed56e312 net: Support "dumping" dummy sit device
This device is an API endpoint, just skip it. Also, prepare the
ground for sit dump.

Issue #11

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-07-25 22:18:37 +03:00
Pavel Emelyanov
b0b9a97086 criu: Version 3.3
Most of the changes this time are preparation for future
new features and optimizations, that hasn't yet been well
tested and polished.

However, we have several new features. The most important
one is the --tcp-close option to help migration of Docker
containers, that constantly change their IP address.

And, as usually, a set of bugfixes.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
v3.3
2017-07-18 21:55:27 +03:00
Cyrill Gorcunov
245b4b3698 files: Don't access value from stack in outer contex
The struct fd_link link allocated in inner context might be
freed before dump call (depending on compiler), instead
use a safer approach.

Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-07-18 20:01:28 +03:00
Pavel Emelyanov
e3311ea37b cgroup: Skip unified hier controllers (v2)
The unified hierarchy controller doesn't have any name, so criu hangs
while parsing this sort of strings.

Let's skip those for now, until we implement cgroup2 support.

https://github.com/xemul/criu/issues/252

v2: Code comments

Reported-and-tested-by: Adrian Reber <adrian@lisas.de>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-07-18 20:01:28 +03:00
Pavel Emelyanov
3ef5a5e20a sk-packet: Don't open image when not needed
It looks like this call to open_image was left from the
times when we reworked packets sending and collected
them early.

✓ travis-ci: success for sk-packet: Don't open image when not needed
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-07-18 20:01:28 +03:00
Bernhard M. Wiedemann
eda4bc554a kdat: allow to override build time
in order to allow for reproducible builds.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-07-18 20:01:28 +03:00
Veronika Kabatova
3c62d950e2 Change tcp-close option to negated style
Code for tcp-close option was added after boolean-valued options
were modified to accept their negations as well. Since tcp-close
option works only with boolean values and does not accept any
argument, it should be wriiten in the same manner to allow users
to override the value when using configuration files.

Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-07-18 20:01:28 +03:00
Veronika Kabatova
8fcfa59b04 Add long option for verbosity changes
Only long options are supported in configuration files. "-v" is the only
short option which doesn't have a corresponding long option, therefore
users wouldn't be able to setup verbosity in configuration files without
this patch.

Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-07-18 20:01:28 +03:00
Alice Frosi
adc47efdd2 zdtm/static/sem: Use "union semun" instead of int
Use "union semun" for semctl() to make testcase also work on s390x.

Signed-off-by: Alice Frosi <alice@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-07-18 20:01:28 +03:00