It's ugly but should work for now. Strictly speaking
I need to rework the complete make engine used in
zdtm.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Tested-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
- drop '\' and ';' after the while(0)
- drop empty line
- use sizeof(*ptr)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
./test/zdtm.sh -i 2 -P ns/static/env00
v2: make the help message a bit more detailed
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We have a big mistake in how we track for ptes to be SOFT_DIRTY -- no
need in these checks if the --track-mem is not given.
While fixing this, remember proper checks for the kernel memory tracker.
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reported-by: Tim Schürmann <info@tim-schuermann.de>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
While doing pre-dump we don't do proper VDSO fixups, thus at
this stage we may fail the should_dump_page() checks -- it
will tread VDSO pages are 'regular' and may skip dumping some
of them.
This is not bad as is, but the subsequent dump will properly
spot VDSO are and will try to dump _all_ pages from it. And
if checks for soft-dirty will report that some pages are clean,
dump will try to locate those in parent images and would fail.
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
If we're doing the pre-dump command we don't have the tasks'
IDs collected, so we have the current_ns_mask uninitilized.
Thus we create parasite transport socket in criu's namespace
always and pre-dump of task, sitting in foreing net namespace
may hang.
From the "performance" point of view, it's easier to always
create transport socket in victim's namespace, rahter than
getting the current_ns_mask.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
There is no way in options to make page server send data
to another page server -- the address/port ones would apply
to local page server.
Thus there is no need to open generic xfer in page server,
just go to local one and avoid confusion
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
While timestamps can be handy, they clutter output for normal users.
Let's print them only when verbosity (-v) is increased from default.
Currently, default is 2 (-vv) so for timestamps one should use -vvv
or -v3.
Alternatively, we could introduce a separate --timestamps option.
Personally, I find it more handy for timestamps to be tied to log level.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This is a slight refactoring of commit 7de9652, which just simplifies
initialization of 'off' variable, and adds the comment why we do so.
Should make the next patch easier to read.
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@parallels.com>
Current description of -v[vvv] was taken from criu-log.h comments
and describes specific log levels used by pr_* functions. The problem
is -vX includes all previous X-1, X-2... levels. Say, -vvvv description
says "debug only", while in fact it is not "only". Fix accordingly.
Also, removed -v0 description as it is useless. What -v0 in fact does is
it sets the log level to default -- same as if -vXXX is not used.
In addition, change a delimiter between option alternatives from comma
to a vertical bar in criu --help output, to be in line with the rest
of usage output.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This is just s/and/end/ to slightly improve readability.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It can be handful to check how a man page looks in PDF or Postscript.
Use 'make ps' and 'make pdf' to generate one.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
* Don't show long usage in case of usage error, otherwise an actual
error message will be lost in long output.
* Print error if command is not specified.
* Return 0 if criu --help is used.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
* Make "invalid usage" type messages uniform
* Use pr_msg() not pr_err(), as we don't want to clutter output
with useless information like (crtools.c:123).
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
* Introduce a generic way to report that option argument is invalid
* Switch to using it from existing places
(options --veth-pair, --port, -n)
* Check for invalid argument of -p and -t and report it.
Notes:
1) In order to correctly print long option name in case it was used
instead of a short one, I had to move "struct option long_opts"
to main() context, this is why the patch is so long.
2) pr_msg() (rather than pr_err()) is used to print errors, otherwise
it is prefixed with that (crtools.c:123) prefix which makes it
look weird.
3) Usage is not shown in case of error, otherwise an error message
is lost in output.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
In case open_image_dir() fails, it prints an error why,
so there is no need to print it one more time.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Use true instead of echo >/dev/null -- same effect, less bytes.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
When running 'make clean' from the top dir, the following error happens:
make[3]: Leaving directory `/vz/kir/git/criu/test/zdtm/live/static'
make[2]: Leaving directory `/vz/kir/git/criu/test/zdtm/live'
set -e; for d in lib live; do make -C $d cleanout; done
make[2]: Entering directory `/vz/kir/git/criu/test/zdtm/lib'
make[2]: *** No rule to make target `cleanout'. Stop.
make[2]: Leaving directory `/vz/kir/git/criu/test/zdtm/lib'
make[1]: *** [cleanout] Error 2
make[1]: Leaving directory `/vz/kir/git/criu/test/zdtm'
make: *** [clean] Error 2
Fix by adding dummy cleanout target to test/zdtm/lib/Makefile
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The ret is overwritten by core read sub-routine. Need
to reset it to -1 to keep failing in case of e.g. last
pid sysctl write.
Reported-by: Neal Becker <ndbecker2@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
When RPC is being requested to check the kernel, it's
enough to check the minimal amount of kernel feature.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We might need to resolve socket paths, which
will require mount infos tree collected.
Reported-by: Neal Becker <ndbecker2@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Two major changes so far -- libcriu.so (RPC wrapper) and plugins.
Both define some API and we want to check this API is good enough.
Thus we tag the -rc1 to let people try it. If things go smooth, we
will just go agead and tar the 1.1.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Makefile is locked, because tests can be executed concurrently.
v2: return non-zero code
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
make ZDTM_ARGS="-C -i 2" -C test/ zdtm_ns -j 8
make is able to execute tests concurrently.
Now we can customize execution of tests
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
If a mount is slave and it has a shared group. crtools must convert it
in slave and only than crtools can make it shared.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
First of all, silly-rename files' names may change, so
kludge the fds comparison properly.
Other than this, allow for linked-remaps on write_read10
test as it effectively generates such on NFS.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We cannot distinguish ghost files from linked-remap for NFS.
Link count is never 0 on such files and any positive value of
it doesn't mean, that the file will stay in place after we
terminate all tasks we dump -- they can hold multiple unlinked
links on the same file and they all will be delayed-unlined.
Checkinf file path doesn't work as well -- silly-rename files
remain visible by VFS, though they shouldn't :(
Fortunatelly, NFS allows creation of additional likns on such
files, so we just create linked remap for such files.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We will need to special-care NFS silly-rename files, thus
we need to know which FS a file belongs to.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The -F|--fields option specifies which fields (by name, comma
separated) should be printed.
For nested fields all names in path should be specified.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Modern tar and rsync can replace zero chunks with holes. So it's valid situation
and shouldn't abort the restore.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
One note -- the macvlan's index _does_ change. We should
either patch iproute2 or use raw kernel API to preserve it.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Well, when we create external link with ip utility we cannot
specify its index. Thus we will not be able to move external
device to namespace and ask criu to restore link params.
However, RTM_SETLINK can happily work with the link name only.
And since we do have one in the images, we can omit setting
the index in the requrest.
TODO: Send patch with index specification to iproute2.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We should call external scripts when namespaces are created,
but before we try to fill them with data from images.
This is done so e.g. to make it possible to push external net
links to netns.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>