On Ubuntu ppc64le, the libxt_standard.so is installed under a
different path.
Adding this path to the dependency list to make the test running on
ppc64le.
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
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>
We'll need this for the next bits and the series, and since dmpi doesn't
modify this or even use it the structure, it's safe.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
A root mount namespace list is used to resolve paths to
unix sockets if they are placed on btrfs.
This patch fixes a crash:
#0 mount_resolve_path at criu/mount.c:213
#1 phys_stat_resolve_dev at criu/mount.c:240
#2 phys_stat_dev_match at criu/mount.c:256
#3 unix_process_name at criu/sk-unix.c:565
#4 unix_collect_one at criu/sk-unix.c:620
#5 unix_receive_one at criu/sk-unix.c:692
#6 nlmsg_receive at criu/libnetlink.c:45
#7 do_rtnl_req at criu/libnetlink.c:119
#8 do_collect_req at criu/sockets.c:610
#9 collect_sockets at criu/sockets.c:636
travis-ci: success for cr-check: fill up a root task mount namespace
https://bugzilla.redhat.com/show_bug.cgi?id=1381351
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
1. GCOV=0 is wrong, it should be left unset (or set to empty value)
2. GCOV=1 only makes sense for TR_ARCH=local, others are not using it
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It contained definitions for F_{SET,GET}PIPE_SZ, which
we already have in "fcntl.h" - it's not big, can be included instead.
Also it has pipe-size specific definitions, which are used only
in page-pipe.c -- moved them to page-pipe.h.
This will simplify include for config.h from subprojects.
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@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>
So, we need CONFIG_HAS_* feature-defines in compel, libsoccr
tools. Let's move this tests upper.
It also reverts commit 411cde8815a4 ("make, soccr: let CRIU depend on
libsoccr"), as we don't need -lsoccr to build feature tests now.
To eliminate any races here, I added $(LIB_FEATURES).
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Otherwise, on some environments, GNU/Make may try to expand
implicit rules right in the top Makefile.
Fixes:
[criu]$ make criu/parasite-syscall.o
...
make -r -R -f /criu/scripts/nmk/scripts/main.mk makefile=Makefile obj=criu criu/parasite-syscall.c
make[1]: Entering directory `/criu'
make[1]: Nothing to be done for `criu/parasite-syscall.c'.
make[1]: Leaving directory `/criu'
gcc -O2 -g -Wall -Wformat-security -Werror -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -c -o criu/parasite-syscall.o criu/parasite-syscall.c
criu/parasite-syscall.c:8:22: fatal error: protobuf.h: No such file or directory
#include "protobuf.h"
^
compilation terminated.
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Removed `config' target, as it only has $(CONFIG_HEADER) dependency.
$(VERSION_HEADER) dependency is in top-make for CRIU's files:
> criu/%: images/built-in.o compel/compel $(VERSION_HEADER) .FORCE
Introduced pattern-specific target for CRIU files, so it
got as dependency pie (and config header as pie's deps).
As we're building from NMK and including source Makefile from there,
it adds Makefile dependency - tell GNU/Make, that it's all right,
up-to-date by introducing Makefile target (otherwise, Makefile
would fit pattern-specific rule).
For any PIE's object I just rebuild/regenerate all pie, it may
be smarter - but we have now Makefile.library and Makefile
for PIE, so need to know, who should rebuild it.
Fixes:
[criu]$ make criu/log.o
make[1]: Entering directory '/home/japdoll/tools/criu'
make[1]: Leaving directory '/home/japdoll/tools/criu'
make[1]: Entering directory '/home/japdoll/tools/criu'
make[1]: 'images/built-in.o' is up to date.
make[1]: Leaving directory '/home/japdoll/tools/criu'
make[1]: Entering directory '/home/japdoll/tools/criu'
make[1]: 'compel/compel' is up to date.
make[1]: Leaving directory '/home/japdoll/tools/criu'
make[1]: Entering directory '/home/japdoll/tools/criu'
DEP criu/log.d
In file included from criu/log.c:22:0:
/home/japdoll/tools/criu/criu/include/string.h:11:20: fatal error: config.h: No such file or directory
#include "config.h"
^
compilation terminated.
CC criu/log.o
In file included from criu/log.c:22:0:
/home/japdoll/tools/criu/criu/include/string.h:11:20: fatal error: config.h: No such file or directory
#include "config.h"
^
compilation terminated.
make[1]: *** [/home/japdoll/tools/criu/scripts/nmk/scripts/build.mk:104: criu/log.o] Error 1
make[1]: Leaving directory '/home/japdoll/tools/criu'
make: *** [Makefile:200: criu/log.o] Error 2
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
When compiling criu with clang, I discovered compilation fails like
this:
GEN criu/pie/restorer-blob.h
restorer_blob: Error (compel/src/lib/handle-elf-host.c:328): Unexpected
undefined symbol: `memcpy'. External symbol in PIE?
This happens because clang emits a call to memcpy for struct
initialization (specifically, struct vdso_symtable in vdso_proxify()).
Naturally, as pie is complied without libc there is no memcpy()
so "compel piegen" rightfully complains.
There are a number of possible solutions to that:
1. Write our own vdso_init_symtable() function instead of using =
2. Use some compiler flags that disables using memcpy
3. Provide own version of memcpy
Now, (1) looks ugly, (2) I was not able to find such flags. Another
argument in favor of (3) is we already have implementation of
builtin_memcpy() optimized for x86.
The only problem is it is not named memcpy(). Using assembler file (.S)
we can have a function with two names (entry points).
For a similar issue in ppc, see commits 0570dd8 and 1ad7817. Ultimately,
we should get rid of builtin_mem* names and just use memcpy(), memcmp()
etc, which in case of non-libc linked objects are to be provided by us.
Cc: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
(cherry picked from commit 214e28089e832d30e381b3780862d3309df17fb8)
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
The util.h it pretty big header, those who need utils
should include it explicitly. Right now some of them
only need xmalloc really.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
The former one (criu-log.h) is now for service functions like logfile
management, pidfile and alike. It's only needed by files that set up
logging and for users that want specific functions like log_get_fd or
pr_quelled.
The latter (log.h) is purely for those who need pr_xxx helpers only.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
After macvlan patches it turned out that util.h needs
int types in, so it's better include it there.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This hook runs after the test is started, in parallel with the actual test.
This can be used in case the test and the host need to coordinate somehow
in order to set something up (e.g. for a macvlan interface).
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>
While tossing headers around non-x86 builds got broken
so move back missing parts for other arches. Other than
criu/arch/ stuff this is mostly int.h over .c files.
travis-ci: success for criu: Remove asm/ includes from non-arch sources
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
The idea is to have one place for headers which
are shared between subprojects (zdtm, criu, compel).
travis-ci: success for Add directory for common headers (rev3)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
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>
Since cr-time binfmt_misc is mounted regardless of mnt_ns
level, it's need just not to be over the system, make
parse method in consistent state with this behaviour.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Option --leave-stopped can now be used during restore,
but this was not reflected in the man page.
[v2: fix wording]
https://github.com/xemul/criu/issues/215
travis-ci: success for criu.8: document restore --leave-stopped (rev2)
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
If p->mountpoint is "/", off will be 0 and we will
try to acess path[-1].
On Tue, Sep 20, 2016 at 05:17:27PM +0300, Kirill Tkhai wrote:
> >
> > int off = 0;
> >
> > ...
> >
> > if (p->mountpoint[1] != 0) /* not / */
> > off = snprintf(path, len, %s, p->mountpoint);
> > if (path[off - 1] == '/') /* p->mountpoint = ./ */
> >
> > ^^^
> > The above looks like off-by-one when off == 0. Is there is
> > a condition which guarantees that off is not zero?
travis-ci: success for mount: skip '/' only if it is there
Reported-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Cc: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Acked-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
travis-ci: success for core-aarch64: mark gregs and clear_tid_addr as (criu).hex (rev2)
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
travis-ci: success for core-aarch64: mark gregs and clear_tid_addr as (criu).hex (rev2)
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
travis-ci: success for core-aarch64: mark gregs and clear_tid_addr as (criu).hex (rev2)
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>