2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 22:05:36 +00:00
Commit Graph

2254 Commits

Author SHA1 Message Date
Cyrill Gorcunov
746ac3fee5 files-reg: Move struct file_remap to the header
We will need to use it in inotify code.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-06 11:10:10 +04:00
Pavel Emelyanov
bae3324447 ghost: Cleanup ghost file dumping
No need in function-wide fd variable for copying file.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-05 22:59:35 +03:00
Pavel Emelyanov
679c5326c3 ptrace: Remove dead code
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-04 23:33:06 +04:00
Pavel Emelyanov
4cd9998544 rst: Brush up fake vs real tasks post-pgid restore codeflow
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-04 18:49:36 +03:00
Pavel Emelyanov
9e7ae345db rst: Remove unused arg from restore_one_helper
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-04 18:43:28 +03:00
Cyrill Gorcunov
fdc56e53f6 proc_parse: Update inotify format
Since fdinfo patches were merged to -mm
tree the output format has been slightly
changed. So update our tool accordingly.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-04 19:28:45 +04:00
Andrey Vagin
caf875454f signal: fix logig about SIGMAX (v2)
A value of signo is in [1, SIGMAX].
Currenly signals are enumirated from 1 to SIGMAX, but SIGMAX
is not included. This patch fixes this mestake.

v2: * save backward compatibility
    * set a correct value of SIGMAX = 64. It can not be in a
    separate patch, because a format is changed again.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-04 19:26:54 +04:00
Pavel Emelyanov
360c50d429 rst: Relax nr_in_progress set in stage switching
When resetting nr_in_progress for next stage no need
in waking up anyone. Nobody waits for it yet :)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-04 17:40:19 +03:00
Pavel Emelyanov
7eaad99ff4 rst: Helper for switching restore stages
Switching to a new stage is 4-step procedure which
deserves its own helper. Besides, now the information
about how many tasks participage in each stage is
collected in one place.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-04 17:37:13 +03:00
Pavel Emelyanov
e0d0dc821d rst: Rename task_entries->nr to ->nr_threads
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-04 17:22:45 +03:00
Pavel Emelyanov
2482c5a24b rst: Move initial nr_in_progress initialization
It's better to init it closer to the rest of rst orchestration.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-04 17:12:37 +03:00
Pavel Emelyanov
70af6cdd62 rst: Helper for restore stage barrier
When finishing a stage we have to report this (decrement the
number of tasks in stage) and wait while stage switch. Write
a helper that does both.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-04 16:59:41 +03:00
Pavel Emelyanov
fa35517082 check: Check for SO_BINDTODEVICE is get-able
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-04 16:35:58 +03:00
Konstantin Khlebnikov
c327e175c4 zdtm: cmdlinenv00 -- fix false positive fail on 'auxv' corruption after 32-bit -> 64-bit migration
Content of /proc/$pid/auxv declared as array of long and this file hasn't compat layer.

https://jira.sw.ru/browse/PSBM-16280

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-03 17:40:32 +04:00
Andrey Vagin
bf598fa28c make: fix navigation in vim
If you have an error in parasite.c and execute make from vim,
without this patch vim opens a new file parasite.c in a root directory.

With this patch vim opens pie/parasite.c.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-03 14:53:17 +04:00
Stanislav Kinsbursky
03791bc2c3 ipc: add check for new IPC sysctls
This patch adds check for "/proc/sys/kernel/sem_next_id" to make sure, that
kernel supports restore of IPC objects.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-30 20:11:18 +04:00
Stanislav Kinsbursky
cbcd5f6b02 ipc: update to use sysctl
Old interface with modified IPC syscalls is deprecated is replaced sy sysctls.
This patch updates CRIU to use new interface.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-30 17:47:15 +04:00
Pavel Emelyanov
1a7c7d0404 fd: Consolidate . and .. checks in various readdir callers
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-29 21:12:51 +03:00
Pavel Emelyanov
86886b6376 util: Fix vma printing message (pass 2)
Remove the ?: ladder, replace it with opt string directly
get from status flags.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-29 18:16:00 +03:00
Pavel Emelyanov
15cfa1b053 util: Fix vma printing message (pass 1)
Use %#x for hexademical fields, fix names to more human-readable.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-29 17:54:44 +03:00
Cyrill Gorcunov
1bc6fec5fd inotify: Don't forget to close opened files on error path
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-29 18:12:16 +04:00
Andrey Vagin
1bebe80c14 zdtm: execute tests on non C/R kernel (v2)
* add exclude list. Tests from this list are executed only on C/R kernels
* check that a version of a kernel is greater than 3.7

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-29 17:45:42 +04:00
Andrey Vagin
08ffa65ed5 socket: don't fail if DIAG_SHUTDOWN is absent
A error message is printed.

We want to save ability to try crtools on non C/R kernel.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-29 17:43:32 +04:00
Andrey Vagin
d08905bf89 log: add pr_err_once
This function prints an error message only once.
[xemul: change ({}) to do {} while (0)]

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-29 17:43:06 +04:00
Cyrill Gorcunov
fe7339570b proc-parse: Inotify files migh have no watchee assigned
Same as eventpoll -- we might have no watchee assigned
but only inotify descriptor created.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-28 21:49:57 +04:00
Pavel Emelyanov
03d0758df3 Revert "net: Introduce netdev index to name resolver"
This reverts commit ef3771d566.
With new SO_BINDTODEVICE getting API it's not required.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-28 20:27:16 +03:00
Pavel Emelyanov
f43c1c2ade sk: Rework bound-dev dump/restore according to new API
The SO_BINDTODEVICE getter is changed in the kernel (before
official release) to report not index, but name to be in
harmony with setter.

Fix crtools accordingly.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-28 20:24:42 +03:00
Pavel Emelyanov
9df1786aea rst: Move and rewrite comment about how restorer blob is prepared
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 22:16:00 +03:00
Pavel Emelyanov
14915d01fd rst: Remove unneeded core file 2nd opening
Presumablty it was lost while reworking core entry restore.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 22:03:36 +03:00
Pavel Emelyanov
827c633b26 rst: Write pidfile in separate fn
Just for better readability.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 21:59:58 +03:00
Cyrill Gorcunov
a016bc84ff zdtm: pthread00 -- Use exit_group where appropriate
Reported-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 20:11:10 +04:00
Cyrill Gorcunov
88ec6bc4ce zdtm: pthread01 -- Add human readable signals printouts
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:33:43 +04:00
Cyrill Gorcunov
bcc7bab7e3 zdtm: Use SIGWINCH+SIGALRM instead of SIGTRAP in pthread01
Otherwise test with -d option get fail (this is because
SIGTRAP get cleared by our parasizte engine).

The proper fix most likely will require kernel patching
or redesign of parasite code. Meanwhile to make test
working we switch to the signal which just known to work.

Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:33:29 +04:00
Cyrill Gorcunov
b675d8a2ee zdtm: pthread01 -- Fix missed sigprocmask -> pthread_sigmask transition
It has escaped me on previous pass.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:33:14 +04:00
Cyrill Gorcunov
12e3d7c43e zdtm: pthread00 -- Use task waiters instead of mmap+sleep pair
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:32:57 +04:00
Cyrill Gorcunov
8ee07313f2 zdtm: pthread00 -- Rename thread functions to more sensible names
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:32:16 +04:00
Cyrill Gorcunov
78e9c40a04 zdtm: Drop mutex from pthread00 test
The tls_data is used for read-cycles only thus
there is no need for mutex since this area get
filled earlier than fork() issued.

Same time on restore the tls filled before the
program restarts.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:31:53 +04:00
Cyrill Gorcunov
593c8d1048 zdtm: Make pthread00 to wait with 0
P_ALL is an argument for waitid, not waitpid.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:31:31 +04:00
Cyrill Gorcunov
465c59457d zdtm: Make pthread00 to use exit(0)
No need for error code here, we test results
by special bitmap.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:31:06 +04:00
Andrey Vagin
20e8eefb01 cr-dump: show virtual PID-s in a log file
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-27 19:20:20 +04:00
Andrey Vagin
bae333dfcb restorer: fix a race condition between access and unmap to task_entries
If we have tree threads, a following situation can occur:

T2: dec task_entries->nr_in_progress
T3: dec task_entries->nr_in_progress
T3: futex(&task_entries->nr_in_progress, WAKE_UP);
T1: unmap task_entries
T2: futex(&task_entries->nr_in_progress, WAKE_UP) -> EFAULT -> BUG_ON()

This patch adds a futex for synchronising threads.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-26 18:46:11 +04:00
Cyrill Gorcunov
6b1d64ca9a tty: Use find_next_bit helper in tty_verify_active_pairs
Since we have find_next_bit in our sources now, lets
use for_each_bit helper to speedup a search procedure.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-26 18:38:28 +04:00
Cyrill Gorcunov
aa53547aed bitops: Add for_each_bit helper
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-26 18:38:15 +04:00
Stanislav Kinsbursky
c5083e4750 make: add pie to include dirs for crtools
cr-restore.c includes parasite-blob.h, which is now located in pie/ dir.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-23 17:12:41 +04:00
Andrey Vagin
13a7498c2a crtools: add EOL to error messages
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-23 16:43:33 +04:00
Andrey Vagin
b7cffae5d4 zdtm: adapt all tcp tests for ipv6
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-23 16:37:39 +04:00
Andrey Vagin
6b2d7f0799 net: don't prevent to dump ipv6 tcp connections
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-23 16:36:37 +04:00
Andrey Vagin
312d1c86f3 netfilter: add ability to block ipv6 connections
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-23 16:36:22 +04:00
Andrey Vagin
a77d00347a test: add a script for executing all app-emu test cases
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-22 19:08:29 +04:00
Andrey Vagin
f8d6dad7f8 test/app-emu: wait while tasks are dying before starting restore
Otherwise some PID-s may be busy.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-22 19:08:14 +04:00