Commit graph

3832 commits

Author SHA1 Message Date
Tikhomirov Pavel
a23765435b test: recursive deduplication
check if size of second parent-level image become smaller

Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-29 15:11:37 +04:00
Tikhomirov Pavel
a02794b79d deduplication: make it recursively deduplicate all parent snapshots
If we write a page into image and punch it from parnet, checking
only one level down is not enough -- the iovec can reside deeper.

That said, make the hole punching be recursive.

Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-29 15:11:35 +04:00
Pavel Emelyanov
004f1f5bbe criu: Version 1.1 release
The bugfix period after 1.1-rc1 seems to be over.
With this version we pin down the API to plugins and libcriu.so.

Next steps will be tied with live-migration usecase for CRIU :)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-28 13:04:03 +04:00
Pavel Emelyanov
f02fb9ed43 Update README file so that it looks more informative on github front page
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-24 20:42:08 +04:00
Pavel Emelyanov
7321723842 xfer: Fix formatting for printg (size_t) iov_len
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-24 17:46:12 +04:00
Pavel Emelyanov
2c500de8ed criu: Remove parent-img service fd
It's no longer needed. All parent manipulations are done in-place
using CR_PARENT_LINK name.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-24 16:12:46 +04:00
Pavel Emelyanov
bfc2895f2a dump: Move pagemap parent checks from mem-dump to page-xfer
When writing pagemaps to page-server we want both page-*.img and pagemap-*.img
to be on remote host. But the subsequent pre-dump/dump with parent images will
try to access pagemap-*img-s to check for hole dumped being present in it.

To handle this, move checks for hole being backed by something in parent into
page-local-xfer. In case of page-server dump it will be page-server who will
check the holes when writing them.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-24 16:02:57 +04:00
Tikhomirov Pavel
c3c0acfe76 deduplication: make seek_pagemap_page properly handle eof
because eof in restore means that we don't have "must have" data, so
it mean error exit, but in dedup, it's ok not to have data we seek, so
we continue returning normally

also it's used that if off < pr-cvaddr then no eof happened and if eof
happened then off >= pr-cvaddr(then return of seek_pagemap_page is 0)

Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-24 15:50:24 +04:00
Andrey Vagin
3b7cc1e45e pre-dump: handle errors from page_xfer_dump_pages()
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-24 15:47:45 +04:00
Andrey Vagin
e36250ef7e mem: handle errors of page_xfer_dump_pages()
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-23 13:27:14 +04:00
Andrey Vagin
d86d0f14e9 zdtm.sh: don't annotate printing separator line
It's useful, if you like execute bash -x zdtm.sh.
zdtm_sep isn't interesting for debugging needs.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-23 13:26:15 +04:00
Andrey Vagin
f220e29889 pie: add EOL in the error message
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-23 13:24:33 +04:00
Pavel Emelyanov
7b6a92c201 page-read: Fix pagemap message formatting
The vaddrs should be %x.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-23 13:23:53 +04:00
Pavel Emelyanov
9f2f4afbcc criu: Version 1.1-rc2
The feedback we got helped us to improve several issues all over
the criu code. And we have some more stuff to get fixed before we
can make a good release.

That said, let's go ahead with the -rc2.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-20 15:28:23 +04:00
Kir Kolyshkin
071312d9d5 Doc/Makefile: error out if req tools absent
Make sure we have a clear message why build it failing, as there are
repeated questions at criu@ mailing list.

Before this patch:

	[kir@kirpad Documentation]$ make
	  GEN      criu.8
	make: *** [criu.8] Error 127

After:

	[kir@kirpad Documentation]$ make
	/bin/sh: line 1: xmltos: command not found
	make: *** [check] Error 1

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-20 14:53:54 +04:00
Cyrill Gorcunov
d01025edd9 zdtm: Force lib to be built before live targets
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>
2014-01-20 14:14:27 +04:00
Andrey Vagin
e970fccb69 dump: call cpu_init() in pre-dump
It's required for dumping fpu state

[root@avagin-fc19-cr crtools]# bash  test/zdtm.sh  -d -P -i 2  static/fpu00
Execute zdtm/live/static/fpu00
./fpu00 --pidfile=fpu00.pid --outfile=fpu00.out
Dump 8411
Dump 8411
Check results 8411
01:29:30.550:  8411: FAIL: fpu00.c:78: 0.806165 != -nan
 (errno = 11 (Resource temporarily unavailable))

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-20 14:13:17 +04:00
Cyrill Gorcunov
394ea23c59 plugin: Use sizeof(*ptr) in cr_lib_load
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-16 22:09:42 +04:00
Cyrill Gorcunov
80dcf8d341 plugin: Standartify add_plugin_func macro
- 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>
2014-01-16 22:09:34 +04:00
Cyrill Gorcunov
8f109f69d8 plugin: Align cr_plugin_entry union members
Otherwise it's almost unreadable mess.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-16 22:09:24 +04:00
Andrey Vagin
fb068a50ad zdtm.sh: add ability to test pre-dump (v2)
./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>
2014-01-16 22:08:52 +04:00
Pavel Emelyanov
04fde2e178 mem: Don't track memory changes if --track-mem is not specified
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>
2014-01-16 22:07:44 +04:00
Andrey Vagin
21b5bcc075 zdtm/make: return .PHONY for default
I don't why it is required here, but make doesn't work w/o it

make[2]: Leaving directory `<https://10.30.26.89/job/CRIU/ws/test/zdtm/live/static'>
make[1]: Leaving directory `<https://10.30.26.89/job/CRIU/ws/test/zdtm/live'>
set -e; for d in lib live; do make -C $d default; done
make[1]: Entering directory `<https://10.30.26.89/job/CRIU/ws/test/zdtm/lib'>
make[1]: *** No rule to make target `default'.  Stop.
make[1]: Leaving directory `<https://10.30.26.89/job/CRIU/ws/test/zdtm/lib'>
make: *** [default] Error 2

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-15 14:08:40 +04:00
Andrew Vagin
c0a8672912 zdtm: remove .PHONY from proxy make files
These files doesn't have own rules

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Acked-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-14 23:10:12 +04:00
Pavel Emelyanov
2ec003eb85 predump: Spot the VDSO page/vma in victim task
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>
2014-01-14 22:54:17 +04:00
Pavel Emelyanov
91011328fa criu: Several formatting fixes
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-14 09:33:19 +04:00
Pavel Emelyanov
d9ec409b3f parasite: Always switch netns for transport socket
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>
2014-01-13 22:14:08 +04:00
Kir Kolyshkin
75fef9a6fb test/*/Makefile: fix PHONY targets
Broken by my commit 1fa0c0c05. I swear I was not drunk.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-11 20:24:48 +04:00
Pavel Emelyanov
ee1643f4ab page-xfer: Page server should always open local xfer
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>
2014-01-11 09:27:07 +04:00
Pavel Emelyanov
71f126d2eb page-xfer: Lost \n in the end of error message
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-11 09:19:35 +04:00
Pavel Emelyanov
5226efe328 service: Handle client unexpected disconnection
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-11 09:19:10 +04:00
Pavel Emelyanov
4617b77e34 service: Send dump resp in case of dump failure
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
2014-01-11 09:18:52 +04:00
Kir Kolyshkin
5f9b8794e0 log: only print timestamps when verbosity increased
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>
2014-01-11 09:18:03 +04:00
Kir Kolyshkin
3d9ff2706f print_on_level(): simplify off setting code
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>
2014-01-11 09:17:55 +04:00
Kir Kolyshkin
81ee51f0e8 criu --help, Doc/criu.txt: fix -v option description
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>
2014-01-11 09:17:34 +04:00
Kir Kolyshkin
5a4c1f7368 log.c: fix a typo in a comment
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>
2014-01-11 09:17:26 +04:00
Kir Kolyshkin
19ea709e1a Doc/Makefile: add ps and pdf generation
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>
2014-01-11 09:16:40 +04:00
Kir Kolyshkin
5e10cb7319 Doc/Makefile: make clean less greedy
Only remove the files which we explicitly generate.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-11 09:16:28 +04:00
Kir Kolyshkin
7e3b9079d5 criu: don't show long usage in case of error
* 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>
2014-01-11 09:15:43 +04:00
Kir Kolyshkin
5d12a116f1 criu: unify invalid usage error messages
* 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>
2014-01-11 09:15:32 +04:00
Kir Kolyshkin
946a585273 criu: unify/improve bad argument messages
* 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>
2014-01-11 09:15:25 +04:00
Kir Kolyshkin
8c0feee253 main(): don't dupe open_image_dir() error message
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>
2014-01-11 09:15:04 +04:00
Kir Kolyshkin
fe0a9670f3 simplify dummy rules
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>
2014-01-11 09:14:18 +04:00
Kir Kolyshkin
55fca14c80 make clean: fix
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>
2014-01-11 09:13:47 +04:00
Kir Kolyshkin
40492dc33d test/zdtm/lib/Makefile: more PHONY targets
Forgot these ones

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-11 09:13:23 +04:00
Kir Kolyshkin
1fa0c0c058 test/*Makefile: add/append PHONY targets
...where they are missing.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-11 09:12:35 +04:00
Kir Kolyshkin
55c8be1c16 test/zdtm/lib/Makefile: rm unused targets from PHONY
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-01-11 09:12:28 +04:00
Pavel Emelyanov
068b4f3c9b rst: Error code got hidden by successful core read
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>
2014-01-06 01:08:06 +04:00
Pavel Emelyanov
48d3b1fc67 service: On check req check for minimal kernel support
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>
2014-01-04 23:57:11 +04:00
Pavel Emelyanov
f3222f746e check: Collect mount infos before checking
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>
2014-01-04 23:45:09 +04:00