It will be used to generate tcp packets for restoring half-closed sockets.
travis-ci: success for series starting with [01/21] build: install libnet-dev
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
travis-ci: success for series starting with [1/3] zdtm: call test_init() before doing anything
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Tycho reported that Debian uses custom LDFLAGS to
build criu, this flag get propagated into built-in
targets where we use $(LD) instead causing build
procedure to interrupt
| LINK arch/x86/syscalls.built-in.o
| ld: unrecognized option '-Wl,-Bsymbolic-functions'
| ld: use the --help option for usage information
| /«PKGBUILDDIR»/scripts/nmk/scripts/build.mk:141: recipe for target 'arch/x86/syscalls.built-in.o' failed
Lets make maintainers life easier and filter
out the flags we know never accepted by $(LD).
Reported-by: Tycho Andersen <tycho.andersen@canonical.com>
Tested-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
travis-ci: success for tests: Add RPC testing to CI (rev2)
Acked-by: Andrey Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Apparently, there's no clang-3.8 for Ubuntu Trusty arm64. The latest
available version is 3.6, let's try to use it.
https://travis-ci.org/kolyshkin/criu/builds/173168198
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
In this file one can add options with which to build CRIU.
Each line is (for now) expanded into CONFIG_$(TEXT) macros
defined in config.h that can be tested later in the code.
v2: Add .config to .gitignore
v3: Don't check that make mrproper removes .config
https://github.com/xemul/criu/issues/235
travis-ci: success for Don't compile in binfmt_misc dumping code by default (rev3)
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Reviewed-by: Dmirty Safonov <dsafonov@virtuozzo.com>
If userns_restore_one_link() is called outside of usernsd,
it switches into the criu namespace and switches back before exiting.
v2: rid of the include of linux/net_namespace.h in criu/include/net.h,
as well as the associated defines and feature checks
travis-ci: success for net: simplify restore of macvlan-s (rev2)
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This header was only introduced in 2015, so we need to build without it.
travis-ci: success for series starting with [v10,01/11] net: pass the struct nlattrs to dump() functions
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
As it should be built anyway - it will not increase build time
significally.
Cc: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
1. Move HOSTCC/HOSTLD to nmk (note there are rules in nmk
that make use of these variables already)
2. Make CC/LD derive from HOSTCC/HOSTLD
Note that one can still change anything from the command line.
travis-ci: success for build system: make CC/LD derive from HOSTCC/HOSTLD
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Setting GCOV environment variable is used for doing profiling (gcov).
Unfortunately, it is checked in two different ways:
1. In top Makefile and scripts/travis, it is checked against "1".
2. In other places, it's checked to be set to a non-empty value.
So, giving various values to GCOV will lead to different results.
Let's unify the approaches used. Apparently, among all the code the
easiest (and not too strict) way is to check for non-empty value
(this also leads to the smallest possible patch size).
Note that in Python, evaluating an empty string in a binary context
(such as after an "if" statement) equals to False.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
With this patch, Travis will build/test CRIU using clang, for real.
I swear I fixed it before, but the fix was apparently lost.
travis-ci: success for series starting with [1/3] compel: mv noexecstack from CFLAGS to LDFLAGS
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
I don't know why they were disabled, but they work fine.
travis-ci: success for travis: execute cgroup tests
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
With this, one can do a CRUI build via QEMU+Docker using clang
as a compiler, for example:
make -C scripts/build alpine-clang
make -C scripts/build ppc64le-clang
For alpine, default clang version is used. For others, a version has
to be specified explicitly, as there is no package called "clang" in
Ubuntu Trusty (which is used as a base for most arches). Since
clang-3.8 appears to be available from Trusty, and this is the current
stable version of clang, let's use it.
travis-ci: success for QEMU+Dockerfile improvements + clang build
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Let's use Ubuntu Trusty Tahr (aka 14.04) for x86_64 QEMU build, as
1. this is the version that is used for other QEMU arches;
2. Ubuntu Wily, used before, is EOL as of July 28, 2016.
travis-ci: success for QEMU+Dockerfile improvements + clang build
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
I just spent some considerable time trying to figure out the source
of errors like this:
make -C scripts/build ppc64
...
DEP images/autofs.pb-c.d
In file included from images/autofs.pb-c.c:9:0:
images/autofs.pb-c.h:7:35: fatal error: protobuf-c/protobuf-c.h:
No such file or directory
#include <protobuf-c/protobuf-c.h>
^
compilation terminated.
It appears that we copy the complete tree to a docker container, and it
is not cleaned properly before the build. In particular, images/*.pb-c.{c,h}
are not removed/rebuilt. The problem is not noticeable until version of
protobuf-c differs between the host and container, and they use different
include paths (/usr/include/google/protobuf-c/ vs /usr/include/protobuf-c).
As I don't want anyone else to spend so much time figuring this out,
here is the patch.
travis-ci: success for QEMU+Dockerfile improvements + clang build
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
git is needed as the top-level Makefile calls it. Strictly speaking
git is not required to build CRIU, but it's better to have it than
to see some error messages.
coreutils is needed for nproc utility which is called from Dockerfile:
make -j $(nproc)
Before this patch, it was equivalent to "make -j" (plus an error
message) which is not the best thing to do.
travis-ci: success for QEMU+Dockerfile improvements + clang build
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Patches moving code around and changing packages list conflict
with each other all the time. Split these two :)
travis-ci: success for travis: Put package list in a variable
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Move GCOV to travis environment, so now we can change it easily
on a per-build basis.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
We are going to use this script for testing linux-next.
v2: remove bashism
travis-ci: success for scripts: allow to skip travis specific parts in travis-tests (rev2)
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This helper uses other binaries (like awk), which can fail or be killed.
It this case might be, that no mountpoint is found.
Or, on other hand, the whole mount point path is wrong, and is absend in
mountinfo.
Return explicit error in this case.
Without this patch, script will proceed further, and, since returned value is
empty, it doesn't equal to "autofs", so script will try to bind-mount autofs
mount, resulting in hung.
travis-ci: success for systemd-autofs-restart.sh: explicitly return result from get_fs_type
Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
I discovered that the scripts/ suffix is added to __nmk_dir despite
the fact it already contains it, ending in obviously wrong filenames
like scripts/nmk/scripts/scripts/msg.mk. As those files are non-existent,
make tried to recreate every .mk file, spawninga child to execute 'true'
command, like this (part of "make -dr" output):
> Considering target file '../scripts/nmk/scripts/scripts/include.mk'.
> File '../scripts/nmk/scripts/scripts/include.mk' does not exist.
> Finished prerequisites of target file
> '../scripts/nmk/scripts/scripts/include.mk'.
> Must remake target '../scripts/nmk/scripts/scripts/include.mk'.
> Putting child 0x564ec1768740 (../scripts/nmk/scripts/scripts/include.mk)
> PID 21633 on the chain.
> Live child 0x564ec1768740 (../scripts/nmk/scripts/scripts/include.mk)
> PID 21633
> Reaping winning child 0x564ec1768740 PID 21633
> Removing child 0x564ec1768740 PID 21633 from chain.
The fix was to remove the extra scripts/, but once I did it, I found
out problem #2: these targets, being defined in contents that is often
included in the beginning of Makefiles, hijacks the default make
target (the first one in the Makefile), breaking the usual and
expected make behavior, and forcing to use .DEFAULT_GOAL.
Finally, I don't know why these targets are there, i.e. what purpose
do they serve. Maybe it was done to exclude any implicit rules to
re-make those files, but there are no such rules as far as I can see.
So, in order to address problem #2, I have removed these targets.
I don't see any harm in doing that; let me know if it breaks anything.
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Let there be more make-tests.
Cc: Adrian Reber <adrian@lisas.de>
Cc: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
From 5f6b24723b1d029d3c764aaa8dea31b8497c3905 Mon Sep 17 00:00:00 2001
From: "Tuan T. Pham" <tuan@vt.edu>
Date: Thu, 8 Sep 2016 03:42:12 -0400
Subject: [PATCH] Add script to install required packages to compile in Debian
In order to setup an environment to compile and to test CRIU
from source, we need to have required packages in Debian
environment.[^0] This script and its package list will help
setting it up.
contrib/debian/dev-packages.lst:
* List of required packages for Debian development environment
scripts/install-debian-pkgs.sh:
* A simple bash script instaling the required Debian packages
[0]: https://criu.org/Installation
Signed-off-by: Tuan T. Pham <tuan@vt.edu>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Add a new option to zdtm.py to run "criu dedup" after "criu dump"
or "criu pre-dump".
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Make sure travis/jenkins complain if someone sends a patch
that results in criu --help output violate standard terminal
width requirement.
Cc: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
We need to allow read/write access for these directories to execute
tests in user namespaces. zdtm.py does this too, but it is racy if
we run a few tests in parallel.
------------------------ grep Error ------------------------
(00.748406) 5: Error (criu/files-reg.c:1487): File zdtm/static has bad mode 040777 (expect 040775)
(00.752027) 1: Error (criu/cr-restore.c:1132): 5 exited, status=1
(00.790562) Error (criu/cr-restore.c:1135): 88 killed by signal 9: Killed
(00.790623) Error (criu/cr-restore.c:2019): Restoring FAILED.
------------------------ ERROR OVER ------------------------
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Without this patch any error in check_fs_type function is considered as a
grant to process to bind-mount.
This patch splits mount point fs type discovering and comparison to autofs
type, thus allowing to check for discovery errors.
Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
We found that the 3.19 Ubuntu kernel has a bug and
the pagemap cache doesn't work properly on this kernel.
Unfortunately Travis-CI allows to create intancies only with this kernel,
so we need to add this workaround.
https://github.com/xemul/criu/issues/207
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It is very hard to investigate travis fails, when something is segfaulted.
Let's add our own core file handler which will provide all required
information for us. Now test/abrt.sh shows a process tree,
process mappings, registers and backtraces.
v2: change a variable name
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Thanked-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It works faster and checks that two criu processes can work concurrently.
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
- simplify: don't use temporary file -- use /dev/null instead
- return 'true' or 'false' -- this way we can use it inside rules
without external call to bash to compare return with 'y', see
the next patch for a use case.
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
There can be autofs direct mount point without target mount on top.
In this case there won't be any bindmount and nothing to restore on top of the
autofs mount point.
Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It's a new option to get/set window parameters.
v2: don't do this check to unprivileged users, because TCP_REPAIR
is protected by CAP_NET_ADMIN.
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
So, how it was working:
1. build-as was declared with $$(1) and $$(2) which were expanded
on entering the submake;
2. function $(call build-as,...) performed the second expansion of
build-as.
Cons: build-as works only in sub-makefile, no sub-sub-makefile, no
upper/top makefile.
Simplify this by single $(1).
Then build-as variable will be used _only_ in makefile, not in
sub-makefiles.
This is for now fine, as each file, that calls $(MAKE) with
$(build)=dir or $(call build-as,makefile,dir) will include main.mk
from NMK, which has build-as definition (from include.mk).
In the future, we'll get rid of $(build) and $(build-as) workarounds
as finally switch to building from a global makefile.
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It looks like, there is not so much that needs to be fixed for
building criu from a top directory.
After the patch it's possible to do `make criu/mount.o` i.e.
It will build protobuf, compel as dependencies (if they are not built),
but no more from criu objects. If something breaks, you can
do make from vim and jump to error. Nice.
Mostly the patch corrects pathes to objects - I tried to make them
depend on $(obj) or $(SRC_DIR)/criu, where it's possible.
After it tested:
`make -j 10`, `make criu/log.o`, `make clean`, `make mrproper`,
`make install DESTDIR=/tmp/criu`, `make uninstall DESTDIR=/tmp/criu`
Note: I improperly called v1 for this patch as "return to make from
top Makefile" -- but I didn't mean that (and it was friday ;)
This patch doesn't yet switch to top-Makefile building, but that's
a step in that way (building from a top Makefile needs correct pathes
in makefiles) which also adds ability to build objects in subdirectories
and etc.
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It's required for collection full report for tests
which are executed in separate mount namespaces.
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>