files: Convert fdescs hash from list-s into hlist-s

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
test/zdtm: clear unused variable "FILE_LOCK_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>
test/zdtm: add -g option to generate binary only

Add -g option in zdtm.sh.

Using -g option can just generate binaries of all
tests to run in zdtm. Moreover, appending test name after
-g option can just generate the binary for the test.

Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
test/zdtm: use TEST_PATTERN as argument

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>
page-server: Convert opts.addr into char *

We'll have --address argument reused for library, so make this
abstract address, not ipv4 one.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
stats: Prepare for collecting restore stats

Restore stats are difficult -- we have to collect them from several
tasks and thus existing plain variables would not work. We'll need
shared memory with stats, so prepre for allocating one.

Other than this -- put call to write_stats() where appropriate for
restore.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
stats: Allocate dumping stats dynamically

For restore all this memory would be unused. Plus, we'd need some
sign what stats to collect.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
stats: Rename existing timing and cnt counters into dump_... ones

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
atomic: Add atomic_add for x86

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
stats: Introduce counters for restore

These are atomic_add-s on shmalloc-ed stats.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
stats: Introduce protobuf message for restore stats

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
rst: Collect stats about checked-vs-cowed pages

On restore we compare pages' contents with memcmp to check which
of them can remain shared. Report this info in restore stats.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
arm: Add atomic_add

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mm: do check on shared pages only if a vma is inherited (v2)

v2: restore page contents directly into memory
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
test: adjust the output for tests

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>
test/zdtm: add option -n for batch test

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>
zdtm: exit with the zero code if everything is ok

Cc: Yicheng Qin <yichengq@google.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
util: Make set_proc_fd report success/error only

Returning the new proc fd value is useless.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
util: Use open_detahc_mount helper for proc service fd creation

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
util: Make set_proc_mountpoint static

And rename it to better reflect what it does.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>