If a task opens a file, then goes chroot, CRIU should still
be able to dump and restore the now-invisible file.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This patch detects the race, when a signal hanler could be executed
during restore.
More details are in: 5d18eca restorer: Block signals early
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Some VMA-s can be merged on restore. For example, If a process maps
VMA1, VMA2 and then VMA3 between the previous ones.
|VMA1|VMA3|VMA2|
The VMA3 will be merged only with VMA1, but all three VMA-s will be
merged on restore, because they are mmaped in a correct order VMA1,
VMA3, VMA2.
Due to this issue, we have a small script for merging continuous VMA-s.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
After parsing options we expect either 0 or 1 arguments, no more.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Easier that way
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It's cleaner to have all options parsed in the same way (and in the same
manner).
Factor out usage() and call it when -h is found.
Also, print usage text to stdout not stderr.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It's more cleaner to have all options parsed in one place.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Looks cleaner this way.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It's got not get.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
For longer multi-line statements, let's use traditional
if ... ; then ... fi
Short form is OK (better?) for one-liners only.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Just 'cause this is not C.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It's either "are different" or "differ".
Let's use the shorter form.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
At first I wanted to just fix spelling in "commited" and
"meainstream", but ended up using better wording for this.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
There are a lot of bash-only statements in this script, so let's
ask for /bin/bash explicitly to avoid weird errors when running
on e.g. Debian which have dash installed by default.
Alternatively, we can rewrite this to be pure shell, but it's
too much work to do.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The kernel must be 3.11 or greater due to
29000cae ptrace: add ability to get/set signal-blocked mask (v2)
The patches for dumping tun devices are not committed in the upstream
kernel yet, so ns/static/tun is excluded.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
When tests are executed concurrently all of them use
the same root, so libraries must be copied atomically.
Without this patch we can get errors like this:
cp: cannot create regular file ‘/tmp/criu-root.m45u5Y/lib64/ld-linux-x86-64.so.2’: File exists
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It's a special case, because if we've split the stack vma,
only the lowest one has the guard page.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The kernel was compiled without the tun driver.
This reverts commit 889a21292f4de856a0d6d68a4c6a3b2f16aa3627.
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
setuid and setgid drops the dumpable flag, so it should be set back.
Otherwise proccesses will not able to read a few files in proc (e.g.
/proc/pid/pagemap).
This patch affects cow01:
11:50:04.429: 4: ERR: cow01.c:99: Unable to read data (errno = 13 (No such file or directory))
v2: typo fix
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This reverts commit 21d94e00866e34e518a3d8501f02f8a0a681a0b5.
This patch was created for investigating
https://bugzilla.openvz.org/show_bug.cgi?id=2676
The bug is fixed and this patch does nothing useful, because tcpdump
starts too late.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
There's some strange setup on Jenkins boxes, so that /dev/net/tun
is inaccessible. Need to check this after holidays :(
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The option can run test with specified name directly without check
or match.
It can be used to run experimental test that is not in TEST_LIST.
Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Currently, env.sh only contains the location of criu executable.
Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
In batch-test mode, the script skips failed individual tests
instead of exiting. This ensures that all zdtm tests can be run
in one pass, which provides better overview of test result.
Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Adjust the format of information printed.
Print out more necessary debug information.
Display error message in STDERR and make it more readable.
Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Use TEST_PATTERN instead of TEST_NAME as argument.
All previous zdtm commands can be used still.
It is useful to run certain part of tests.
Example of running in-namespace tests only:
./test/zdtm.sh ^ns/.*
Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>