2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00

299 Commits

Author SHA1 Message Date
Zhang Ning
e7aba32efe tools.mk: support override CC/LD command line
due to Android NDK's clang is x86_64-linux-android28-clang --sysroot ${SYSROOT_PATH}
and it's ld is x86_64-linux-android-ld,
it's not able to use a single pattern to discript clang and ld.

and there is a error for x86_64-linux-android-ld.
x86_64-linux-android-ld  -L/home/ning/source/criu/protobuf-c/../target/lib -lprotobuf-c -r -z noexecstack -T ./compel/arch/x86/scripts/compel-pack.lds.S  -o criu/pie/parasite.built-in.o  criu/pie/parasite.o criu/pie/pie.lib.a ./compel/plugins/std.lib.a
./compel/compel-host hgen -f criu/pie/parasite.built-in.o -o criu/pie/parasite-blob.h
Error (compel/src/lib/handle-elf-host.c:335): Unexpected undefined symbol: `'. External symbol in PIE?
criu/pie/Makefile:49: recipe for target 'criu/pie/parasite-blob.h' failed

rebuild with host ld, can pass build.

so support override CC/LD from command line can pass build.

Cc: Chen Hu <hu1.chen@intel.com>
Signed-off-by: Zhang Ning <ning.a.zhang@intel.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Andrei Vagin
0d5c0b2d3a scripts/build: use the last stable release for s390
And get qemu-static from the 18.04 LTS Ubuntu repos.

https://github.com/checkpoint-restore/criu/issues/652
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Radostin Stoyanov
b3a199186d docker-test: Fix deprecated security-opt format
The flag --security-opt doesn't use the colon separator (:) anymore
to divide keys and values, instead it uses the equal symbol (=) for
consistency with other similar flags, like --storage-opt.

Deprecated in release: v1.11.0
Target for removal in release: v17.06

https://docs.docker.com/engine/deprecated/

 #653

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2019-04-20 20:25:26 -07:00
Mike Rapoport
d416c78d71 travis: lazy-pages: exclude most tests for kernels <4.18
Although non-cooperative userfaultfd events have been merged into the Linux
kernel since 4.11 they were racy until 4.18.

Exclude "dangerous" tests for older kernels.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
2019-04-20 20:25:26 -07:00
Takashi Iwai
0493724c8e Documentation: Allow to use asciidoctor for formatting man pages
Since asciidoc is based on Phyton 2, we want to move to alternative,
and a promising one is asciidoctor.  This patch allows to use
asciidoctor for formatting man pages instead of asiidoc, by passing
a make option, USE_ASCIIDOCTOR=yes.

Although asciidoctor is almost compatible with asciidoc, it can
produce a man page directly from a text file without XML, which is
more efficiently.  So in asciidoctor mode, we don't require xmlto.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Takashi Iwai
f73e5d181b Documentation: Remove unused a2x check
a2x is never used although its presence is checked mandatorily.
Let's remove this superfluous check and the unused entry.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Andrei Vagin
b8fdcd71f8 travis/fedora: install the kmod package
This patch fixes the error:

(00.074175) Error (criu/net.c:2638): Locking network failed:
iptables-restore returned -1. This may be connected to disabled
CONFIG_NETFILTER_XT_MARK kernel build config option.

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Andrei Vagin
42bc32f6c0 travis/docker: install docker from the test repo
C/R in Docker from the stable repo is broken.

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Andrei Vagin
02018f01f1 travis: switch to the Ubuntu Xenial
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-04-20 20:25:26 -07:00
Andrei Vagin
be28d924cb lint/python: ignore E117 over-indented
After recent update of flake8, we have a lot of e117 warnings:
test/zdtm.py:1748:5: E117 over-indented
test/zdtm.py:1751:5: E117 over-indented
test/zdtm.py:1755:6: E117 over-indented
test/zdtm.py:1757:7: E117 over-indented
test/zdtm.py:1764:6: E117 over-indented
test/zdtm.py:1766:5: E117 over-indented
test/zdtm.py:1767:6: E117 over-indented

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-02-16 11:06:01 -08:00
Andrei Vagin
eccdf07ae3 python fix lint warnings
flake8 started to report warnings like this:
test/zdtm.py:1337:6: W605 invalid escape sequence '\S'

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-10-30 19:28:19 +03:00
Mike Rapoport
d9c7787ed3 travis: lazy-pages: exclude futex test for older kernels
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-10-30 19:28:18 +03:00
Radostin Stoyanov
7ce23b2a74 python: Remove unused imports
Auto-detected with pylint.

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2018-10-30 19:28:01 +03:00
Cyrill Gorcunov
9ca150867f nmk: Make collect-deps to be more precise about targets
Thus to choose which deps to include, for example if only
particular file is being build there is no need to include
any other deps.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:56 +03:00
Cyrill Gorcunov
44b6705324 nmk: Add obj and lib deps gathering via helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:56 +03:00
Cyrill Gorcunov
dfaf0868b4 nmk: Add collect-target-deps helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:56 +03:00
Cyrill Gorcunov
e4f62b929c nmk: Add collect-hostprogs-deps helper
Thus will include hostprogs deps only if requested.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:56 +03:00
Cyrill Gorcunov
733c5b0b6f nmk: Align continuations
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:56 +03:00
Cyrill Gorcunov
edbac23ffb nmk: Drop unneeded ld_flags
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:56 +03:00
Cyrill Gorcunov
d3b4fbc2ac nmk: Gather reserved vars on top of build
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:56 +03:00
Cyrill Gorcunov
6ed2532b36 nmk: Filter out already seen targets from collect-deps
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:56 +03:00
Cyrill Gorcunov
faa8bae6f2 nmk: Don't include deps on mrproper
mrproper doesn't require inclusion of deps similar
as clean target.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:56 +03:00
Adrian Reber
077409c197 travis: fix rawhide test by also installing sudo
Signed-off-by: Adrian Reber <areber@redhat.com>
Acked-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Acked-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:53 +03:00
Adrian Reber
ae55a6ccd5 tests: fix builds on alpine and centos
Install sudo, create test user with ID 1000, install bash,
fix pidfile creation and pidfile chmod.

v2:
 * use sleep to give the criu daemon some time to start up

v3:
 * Andrei is of course right and sleep is not good solution.
   After adding --status-fd support to criu service, this
   is how we now detect that criu is ready.

v4:
 * This was much more complicated than expected which is related
   to the different versions of the tools on the different travis
   test targets. There seems to be a bug in bash on Ubuntu
    https://lists.gnu.org/archive/html/bug-bash/2017-07/msg00039.html
   which prevents using 'read -n1' on Ubuntu. As a workaround
   the result from CRIU's status FD is now read via python.

   Another problem was discovered on alpine with the loop restore test.
   CRIU says to use setsid even if the process is already using setsid.
   As a workaround, still with setsid, this process is now using
   shell-job true for checkpoint and restore.

Parts of v2 have been committed before. So the changes from this commit
are partially already in another commit.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:52 +03:00
Adrian Reber
2c5b2785ed tests: fix builds on alpine and centos
Install sudo, create test user with ID 1000, install bash,
fix pidfile creation and pidfile chmod.

v2:
 * use sleep to give the criu daemon some time to start up

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:52 +03:00
Adrian Reber
6a49d037aa travis: run test/other/rpc tests
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-10-30 19:27:52 +03:00
Adrian Reber
fc11d59db1 travis: fix building on s390x
The travis build for s390x started to fail with:

Failed to fetch http://security.debian.org/debian-security/dists/jessie/updates/InRelease Unable to find expected entry 'main/binary-s390x/Packages' in Release file (Wrong sources.list entry or malformed file)

This changes the repository definition just like it is done for ppc64le.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-10 08:38:09 +03:00
Andrei Vagin
b988fae544 travis/docker-test: use make to install criu
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:26:52 +03:00
Adrian Reber
55d0f98fc9 scripts/systemd-autofs-restart.sh: fix variable name
The script checks if $NSENTER is executable and sets $NS_ENTER if not.
This seems to be a typo (once with '_' and once without).

Untested and not reproducible. It just looks wrong.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:26:50 +03:00
Andrei Vagin
d76ddb5e83 test: run a full set of tests in docker containers
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:26:48 +03:00
Andrei Vagin
5604ccbe60 build/docker: install packages to run tests
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:26:48 +03:00
Andrei Vagin
0e05bdfe27 travis: run the crit-recode test
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:26:48 +03:00
Andrei Vagin
841edaf317 lib: a few fixes to be compatible with python3
All these issues was found by running test/crit-recode.py

https://github.com/checkpoint-restore/criu/issues/495

v2: drop FD_CLOEXEC for swrk descriptors
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:26:48 +03:00
Andrei Vagin
0dab224be6 travis: set python3 as default for fedora containers
We need a few jobs to check a compatibility with python3

v2: fix inhfd and rpc tests
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:26:48 +03:00
Adrian Reber
553dd546b5 travis: fix python2 package installation
For python2/python3 compatibility install additional (python2-future)
and different (python2-ipaddress) packages during test.

Also switch Fedora tests to explicitly install versioned python packages
(python2-* instead of python-*).

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:25:16 +03:00
Adrian Reber
1a0ad1ae87 Makefiles: auto-detect python version - prefer python2
This prepares CRIT for python2/python3 compatibility by auto-detecting
the installed python version. python2 is detected first and then the
variable PYTHON is set.

By setting the variable PYTHON to python2/python3 the user can override
the auto-detection.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:25:16 +03:00
Adrian Reber
98cb5c627d crit: make crit python2/python3 compatible
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-09 18:25:16 +03:00
Andrei Vagin
1099cf0639 travis: build criu and run tests on centos
It is one of our target platforms.

Cc: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Acked-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-07-04 04:16:09 +03:00
Andrei Vagin
7af751b569 test/other: add a test to check the --shell-job option
This test creates a pty pair, creates a test process and sets a slave
pty as control terminal for it.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-14 08:45:49 +03:00
Andrei Vagin
5d3ea878fb travis: rollback to fedora 27
We have a few issues with fc28. For example:
https://github.com/checkpoint-restore/criu/issues/469

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-12 11:45:33 +03:00
Dmitry Safonov
c2876c2f25 nmk: Don't redefine MAKEFLAGS
$(MAKEFLAGS) already contains -r -R and --no-print-directory: those
flags are being added in include.mk.. which is included two lines above.
There is no comment and I see no big sense in erasing $(MAKEFLAGS),
rather than adding those flags. So I considered this as a typo.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-12 11:45:33 +03:00
Andrei Vagin
3e66125e9b [v2] criu: add -fprofile-update=atomic for builds with gcov
Sometimes we see errors like this:
criu/cr-restore.gcda:Merge mismatch for function 106

It proabably means that this gcda file was corrupted. According to the
gcc man page, the -fprofile-update=atomic should fix this problem.

v2: this options appered in gcc7, so we need to install it.

Reported-by: Mr Travis CI
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-12 11:45:32 +03:00
Mike Rapoport
bb2af52190 test: lazy-pages: exclude maps007
With userfaultfd we cannot reliably service process_vm_readv calls. The
maps007 test that uses these calls passed previously by sheer luck.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-12 11:45:31 +03:00
Andrey Vagin
6a66b87e12 zdtm: check an exit code of a straced restore
Currently zdtm doesn't detect when restore failed, if it is executed
with strace. With this patch, fake-restore.sh creates a test file, and
zdtm is able to distinguish when restore failed.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-12 11:45:31 +03:00
Kir Kolyshkin
0284e70f4d scripts/build/binfmt_misc: fix for bash
There was a "; done" leftover here, somehow ignored by dash
but not bash. Remove it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-05-12 11:44:33 +03:00
Kir Kolyshkin
a2ab074eca scripts/build/Dockerfile.rawhide: rm
It is not used, probably was committed by mistake.

Fixes: 2d093a170227 ("travis: add a job to test on the fedora rawhide")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-05-12 11:44:32 +03:00
Kir Kolyshkin
c75cb2b58b CI: fix Fedora rawhide
Fix Fedora rawhide CI failure caused by coreutils-single and our
way of running under QEMU.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-05-12 11:44:32 +03:00
Kir Kolyshkin
7c4ddebc35 scripts/build/Dockerfiles: nitpicks
1. Sort lists of packages to be installed, unify indentation.

2. Merge "ccache -s" and "ccache -z".

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-05-12 11:44:32 +03:00
Andrei Vagin
6aa4a9c2f1 netns: restore internal veth devices
When we dump a veth device, the kernel reports where a peer device lives
and we use this information to restore this veth pair.

On restore we set a net ns id for a peer and it is created in the required
netns.

v2: add more comments
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-02-15 21:45:08 +03:00
Andrei Vagin
b2494eae61 test/docker: check a continaer with a read-only file system
Now it's probably one valide use case, because there is no way to commit
a container when a container is being checkpointed.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-12 09:13:37 +03:00