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

2617 Commits

Author SHA1 Message Date
Cyrill Gorcunov
77af03686d make: Add scripts/Makefile.rules
This helpers will be used in rules generation
for new make infrastructure.

At moment only a few helpers here -- to compile
*.c and *.S files, and generate *.d,*.s,*.i files.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:10:40 +04:00
Cyrill Gorcunov
ad4f28cad1 make: Define dummy target for scripts/Makefile.version
At moment built-in .SUFFIXES variable is not cleaned
which slows down the building procedure. Add a dummy
rule thus the make won't try to lookup rules for
scripts/Makefile.version (this happens when last
resort rule is used).

Note that this is rather a stub for future convenience
which doesn't affect much current build procedure.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:10:38 +04:00
Cyrill Gorcunov
4e6eca1881 make: Drop -r flag from $(RM)
It's already defined as RM := rm -f

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-15 17:37:20 +04:00
Cyrill Gorcunov
75e1fb5c3a include/compiler.h: Cleanup
- Drop parasite \Space in NORETURN definition
- Align likely/unlikely

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-15 17:34:38 +04:00
Cyrill Gorcunov
fdfef4b485 headers: Change "../protobuf/" to "protobuf/"
No need to walk up the directories if we need
to include protobuf file. This was always a bad
use of ability to walk the filesystem from other
headers.

Same time we don't need -I$(SRC_DIR)/protobuf/
in general makefile anymore.

[xemul: Small fixlet in head Makefile, since patch
 it out-of-order]

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-15 17:33:06 +04:00
Andrey Vagin
ef4783a646 check: Check for ability to get tcp timestamp
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-14 20:27:55 +04:00
Andrey Vagin
04c48fefbc tcp: dump and restore tcp_timestamp for each socket (v2)
If a TCP socket will get live-migrated from one box to another the
timestamps (which are typically ON) will get screwed up -- the new
kernel will generate TS values that has nothing to do with what they
were on dump. The solution is to yet again fix the kernel and put a
"timestamp offset" on a socket.

v2: don't fail if TCP_TIMESTAMP is unsupported

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-14 20:27:39 +04:00
Cyrill Gorcunov
b752e05e41 dump: Make sure we're dumping task not running in compat mode
It's been reported that we do not test if the tracee is 32bit
task running kn 64bit kernel. This patch adds such test.

https://bugzilla.openvz.org/show_bug.cgi?id=2505

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-14 20:26:29 +04:00
Cyrill Gorcunov
90fbbabb34 make: Generate crtools version from Makefile definition
This allows us to have a unique place where version lives
and what is more important other subsystems (such as docs
generation) may reuse version definitions.

At moment EXTRA (which corresponds kernels -rc tag) and
NAME is not yet used, but I desided to put them in place
for future needs.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-11 19:24:06 +04:00
Cyrill Gorcunov
7d8b5da7d6 net: Do not BUG() if unsupported link type met
But rather exit gracefully.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-11 17:14:20 +04:00
Pavel Emelyanov
c77e52992b locks: Move dump_task_file_locks into file-locks.c
Make all locks code be in one place.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-08 02:58:10 +04:00
Pavel Emelyanov
2cdbeb4a11 files: Move dump_task_files into files.c
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-08 02:54:24 +04:00
Pavel Emelyanov
bd6a0b8919 files: Move do_dump_gen_file into files.c
It's a file dumping fn, it should be there.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-08 02:49:33 +04:00
Cyrill Gorcunov
12298bf470 make: Use -f option for rm
Otherwise I'm getting warnings (especially in zdtm)
when we are trying to remove non-generated .d files.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-07 02:12:23 +04:00
Cyrill Gorcunov
286c8b2384 make: Drop unneeded HEXDUMP
We don't use it at all.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-07 02:12:03 +04:00
Cyrill Gorcunov
f682ba81d3 sockets: Print which socket family is unsupported
It's good to know which family we've met.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-07 00:25:03 +04:00
Cyrill Gorcunov
7a74043c59 zdtm: Add mmap03 test case
To be able to test it one need indeed enough
physical memory on the node (at least 16G).
Thus I don't include this test for regular
passes.

Inspired by commit 40dcaf885e

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-06 21:20:23 +04:00
Cyrill Gorcunov
e8ca542c6a make: pie -- Add generation of dep files
Otherwise pie may not be re-built if headers
are changed.

https://bugzilla.openvz.org/show_bug.cgi?id=2465

Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-06 21:09:04 +04:00
Cyrill Gorcunov
96dd1d22d0 zdtm: Unlink link_remap files once dump complete
In case if only "dump" procedure is invoked we left service
"link_remap.%d" file(s) on disk. This prevents next "dump"
procedure of same test to fail because we hit the situation
where same named "link_remap.%d" already exist.

So, if test is passed with "-d" option we remove the link remap
file at the end.

Also with this patch we start passing --link-remap option
only for tests which have "unlink_" prefix in name. This applies
some limitation on how test could be named, thus maybe we need
more flexible solution here.

https://bugzilla.openvz.org/show_bug.cgi?id=2489

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-06 21:07:16 +04:00
Andrey Vagin
08837c63b1 dump: fix parsing of /proc/locks
is_blocked should be determined for each line independently.

For example:
1: POSIX  ADVISORY  WRITE 1974 fd:01:392012 0 EOF
2: POSIX  ADVISORY  WRITE 1974 fd:01:392011 0 EOF
3: POSIX  ADVISORY  WRITE 1698 fd:01:1196619 0 EOF
4: POSIX  ADVISORY  WRITE 1698 fd:01:1196620 0 EOF
5: POSIX  ADVISORY  WRITE 1698 fd:01:1196621 0 EOF
6: POSIX  ADVISORY  WRITE 1689 fd:01:1429204 0 EOF
7: POSIX  ADVISORY  WRITE 1690 fd:01:1429202 0 EOF
8: POSIX  ADVISORY  WRITE 1690 fd:01:1429201 0 0
8: -> POSIX  ADVISORY  WRITE 1701 fd:01:1429201 0 0
9: POSIX  ADVISORY  WRITE 1688 fd:01:1429206 0 EOF
10: FLOCK  ADVISORY  WRITE 1694 fd:01:1196520 0 EOF
11: POSIX  ADVISORY  WRITE 862 00:0f:12421 0 EOF
12: POSIX  ADVISORY  WRITE 846 00:0f:12377 0 EOF
13: FLOCK  ADVISORY  WRITE 821 00:0f:11378 0 EOF
14: POSIX  ADVISORY  WRITE 459 00:0f:9826 0 EOF
15: POSIX  ADVISORY  WRITE 511 00:0f:10413 0 EOF

Without this patch crtools returns the error:
(00.000613) Error (proc_parse.c:1089): Invalid file lock info!

It's because is_blocked is set in "true" for the line 8 and
it becomes "true" for the line 9.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-06 21:05:53 +04:00
Cyrill Gorcunov
8afd8a4cb2 zdtm: make -- Add -f key on clean* ops
Otherwise if no such files present I'm getting warnings.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-06 01:40:34 +04:00
Cyrill Gorcunov
40dcaf885e parasite: page dump -- Map pages huge bitmap inplace
In case if there is the VMA which has a huge size (4,8,16 G)
then the prealoocated bitmap space won't be enough to track
all pages. Thus we call for system help invoking mmap() call
with bitmap length needed.

We simply assume that if such big VMA present the node has enough
memory to provide us space for pages huge bitmap.

Reported-by: Adrian Reber <adrian@lisas.de>
Tested-by: Adrian Reber <adrian@lisas.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-06 01:38:26 +04:00
Andrey Vagin
ccbbb18ae2 zdtm: check that file permissions are restored for unix sockets
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-30 03:28:09 +04:00
Andrey Vagin
f3cd454cd4 sk-unix: dump/restore a file permissions
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-30 03:28:01 +04:00
Alexander Kartashov
a27f0e5cb0 cr-restore: align the stack on 8-byte boundary
The section 5.2.1.2 of the AAPCS says that the stack must be 8-byte aligned
and this rule is broken when the thread restore_task_with_children()
is forked by the function fork_with_pid() since the variable ca
and its field stack are likely to be 4-byte aligned.

This patch forces 8-byte alingment of the field cr_clone_arg::stack.
This made the following tests pass on ARM:
* static/shm,
* static/ipc_namespace.

Particulary the unaligned stack results in incorrect passing
of the 64-bit argument to the function snprintf() in the function
sysctl_write_u64().

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-29 09:21:46 +04:00
Pavel Emelyanov
5d7cfa8fcf sk: Don't fail collect_sockets in non netns case
This is already so, just move the check for netns case
into collect_sockets. It knows it does so.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-25 15:20:38 +04:00
Pavel Emelyanov
1505815760 sk: Fix check for whether or not to restore namespace in collect_sockets
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-25 15:14:17 +04:00
Cyrill Gorcunov
1f0f2cb995 docs: Put a \Backslash where needed
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-25 14:58:09 +04:00
Cyrill Gorcunov
e28960c348 make: protobuf -- Simplify sed'ing
No need for multiple sed calls, better pass
all options in once.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-25 14:57:52 +04:00
Alexander Kartashov
d9adda7cd1 zdtm: autodetect the target machine v2
Andrew Vagin pointed out that the static testsuite compilation
may run as standalone so the variable ARCH won't be available.

This patch introduces the facility test/zdtm/Makefile.inc
designated to detect the target machine automatically
if the variable ARCH isn't defined. This makefile is supposed
to be included into all test subsuite Makefiles.

Andrew Vagin also pointed out that machine-dependent tests
may be added into non-static subsuites as well so the macro
adding machine-specific headers into CPPFLAGS goes to
the file test/zdtm/Makefile.inc.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-24 15:16:39 +04:00
Cyrill Gorcunov
008457e1e2 make: protobuf -- Order .c files generation
This patch introduce dependencies on .c files
generation parsing import keywords in .proto
files.

In particular, the core.proto file refers to
core-x86.proto which means we need to generate
.[c|h] files from core-x86.proto earlier than
handlig of core.proto.

A positive side effect of this patch is that
the compilation is independent now of order the
proto files are declated in the make file.

Instead of currently present manual order

PROTO_FILES	+= core-x86.proto
PROTO_FILES	+= core-arm.proto
PROTO_FILES	+= core.proto

one can write it in any arrangement, say

PROTO_FILES     += core.proto
PROTO_FILES     += core-arm.proto
PROTO_FILES     += core-x86.proto

and it still be resolved correctly.

BUT beware of circular import directives,
we can't handle them now.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-24 13:22:05 +04:00
Cyrill Gorcunov
d701221e54 make: protobuf -- Generate protofiles deps
Some protobuf files do import another files so
we should generate dependencies and rebuild
the program when needed.

For example core.proto imports core-x86.proto
and core-arm.proto, thus if any of them are
changed the final core.pb-c.c should be regenerated.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-24 13:21:52 +04:00
Cyrill Gorcunov
2e7982ce3f make: protobuf -- Mangle integer constant on ARM only
It's known to work on x86-64 so make the build procedure
a bit faster here.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-24 13:21:35 +04:00
Cyrill Gorcunov
7d1d2e9f9d make: Simplify ARCH retrieval
Actually the former code was being expanding
uname_M variable which is not set that early
(this was not a problem since we assign it a
line below, still it was a dead code which
should be fixed).

Also update

 | ifeq ($(findstring arm,$(ARCH)),arm)

to simple

 | ifeq ($(ARCH),arm)

Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-24 13:20:57 +04:00
Cyrill Gorcunov
629e045466 protobuf: Move arch core resources to core-$(ARCH).proto
To unweave arch dependent part from general core.proto file.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-23 18:22:47 +04:00
Cyrill Gorcunov
10a1045b8a x86: Drop #ifdef CONFIG_X86_64 guard
We do check for proper architectrue in a makefile,
no need for additional guards.

After all porting the project for x86-32 is a far more
bigger than "just implement proper core for parts covered
by #else /* CONFIG_X86_64 */".

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-23 17:43:38 +04:00
Cyrill Gorcunov
709b091f9f make: Yield error on x86-32
Since we don't support x86-32 yet, issue an error early.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-23 17:43:30 +04:00
Cyrill Gorcunov
43407bdf87 make: Drop redundant DEBUG assignment
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-23 17:43:12 +04:00
Cyrill Gorcunov
79f27d49e8 make: Split long lines
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-23 17:43:04 +04:00
Alexander Kartashov
8fa8ca9feb arm: added ARM-specific files modelled after arch/x86
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-22 22:53:24 +04:00
Alexander Kartashov
a0c86a25ab core.proto: added ARM-specific parts to a Core message
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-22 22:52:39 +04:00
Alexander Kartashov
31f9ef8f90 zdtm: moved lib/atomic.h to lib/arch/x86/include/asm/atomic.h
The file lib/atomic.h is the only machine-dependent file in the test suite
that breaks compilation of the test static/session01 on ARM.

The file is moved into a separate directory and the build system is modified
accordingly to prevent this.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-22 22:52:00 +04:00
Andrey Vagin
5500145557 test: add ability to execute tests in parallel
All tests which executed in pid namespaces can be executed in parallel.

$ make zdtm_ns
real	0m54.806s
user	0m2.779s
sys	0m4.338s

$ make -j zdtm_ns
real	0m11.587s
user	0m3.361s
sys	0m5.134s

Another feature of this patch is that the subset of parallel tests is
executed before the subset of sequential tests.

If a first subset are not failed, the second one has a small chance to
fail, so a most part of bugs will be found in a few first seconds.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-22 22:48:00 +04:00
Andrey Vagin
f35bfe1f7d zdtm.sh: exec cleanout per test
It's required for parallel execution of tests.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-22 22:47:58 +04:00
Andrey Vagin
c8484f10ef zdtm: add ablitiy to execute cleanout per test
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-22 22:47:56 +04:00
Andrey Vagin
ea767143f1 tty: require stdin to be a terminal only if shell_job is set
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-22 22:45:31 +04:00
Andrey Vagin
749116b49e crtools: fix the name of --file-locks in the help message
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-21 17:39:26 +04:00
Andrey Vagin
324e432cbb zdtm: get a test file name from arguments
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-21 17:39:18 +04:00
Andrey Vagin
abdaea2421 zdtm: don't hardcode file names
A test should get file names from arguments

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-21 17:39:13 +04:00
Andrey Vagin
cd88cafc37 app-emu/lxc: dump/restore file locks
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-21 17:36:38 +04:00