2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 13:28:27 +00:00

2398 Commits

Author SHA1 Message Date
Cyrill Gorcunov
abdadb51b3 fsnotify: Extend fsnotify_mark_info to carry fanotify marks
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-15 18:34:37 +04:00
Cyrill Gorcunov
6472bdf545 fsnotify: Rename inotify_wd_info structure to fsnotify_mark_info
This structure will carry mark of any type.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-15 18:34:36 +04:00
Cyrill Gorcunov
be534b9ecc fsnotify: Move debug printing into get_mark_path
This prints out more details on what is going on.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-15 18:34:35 +04:00
Cyrill Gorcunov
5425da0b61 fanotify: Introduce get_mark_path helper
We will use it for fanotify objects restore, so to
eliminate code duplication make a separate helper.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-15 18:34:34 +04:00
Cyrill Gorcunov
f385d32da5 image: fanotify -- Add scaffold code for fanotify objects
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-15 18:34:32 +04:00
Cyrill Gorcunov
4629ecd391 protobuf: fsnotify -- Add fanotify entries
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-15 18:34:31 +04:00
Cyrill Gorcunov
78259da381 fsnotify: Add is_fanotify_link helper
Will need it to dump fanotify objects.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-15 18:34:30 +04:00
Cyrill Gorcunov
f58ab92cfe mount: Add lookup_mnt_id and lookup_mnt_sdev helpers
We will need to lookup mount points by mount id
and device for fanotify restore.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-15 18:34:28 +04:00
Cyrill Gorcunov
2d4a16c6ad syscall: Add __NR_fanotify_init and __NR_fanotify_mark
Will need them to restore fanotify objects.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-15 18:34:27 +04:00
Cyrill Gorcunov
b724096f0f fsnotify: Rename inotify files to fsnotify
We will be handling both inotify and fanotify
objects here thus to make less confusion rename
the files to fsnotify.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-15 18:34:26 +04:00
Andrey Vagin
456884ea8e zdtm.sh: exit with zero in case of success
A bash script exits with code of a last command,
so zdtm.sh return 1 if TMP_TREE is not initialized.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-15 17:57:45 +04:00
Andrey Vagin
64706655b6 zdtm: check SO_REUSEADDR is restored
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 18:47:26 +04:00
Andrey Vagin
b1abc3b21c restore: don't desable tcp repair mode twice
TCP repair mode should be disabled after unlocking connections.
Disabling of repair mode drops SO_REUSEADDR, so it should be restored.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 18:47:19 +04:00
Alexander Kartashov
effe3294d9 zdtm: added target architecture checks into FPU tests
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Acked-by: Andrey Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 18:27:52 +04:00
Pavel Emelyanov
6773090014 core: introduced the macro CORE_THREAD_INFO to access the machine-specific part of CoreEntry
This is the merge and a slight rework (no TI_SP macro) of Alexander's patches
about the subj.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 17:19:06 +04:00
Andrey Vagin
8018063933 zdtm.sh: execute all zdtm test case for a defined commit
This functionality can help to test a patch set:
for i in `git rev-list HEAD~15..HEAD`; do
	./test/zdtm.sh -c $i || break;
done

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 15:52:34 +04:00
Andrey Vagin
a19cf2be41 zdtm.sh: use another directory for a temporary crtools tree
It's more convinient for a few reasons
* don't need to recompile sources for each test case
* don't change the current tree

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 15:52:18 +04:00
Andrey Vagin
07f5c3fecf zdtm: compile a test before constructing a new root
A binary is required to get shared library dependencies

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 15:52:05 +04:00
Andrey Vagin
fb14f5d118 zdtm: remove mentions of test_init
test_init was removed a long ago

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 15:52:00 +04:00
Andrey Vagin
e513535b14 zdtm.sh: fix absolute path to crtools
zdtm.sh launched by an absolute path exits with an error due to
an incorrect path to crtools

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 15:51:54 +04:00
Cyrill Gorcunov
24887c6e9c log: Add generic __print_on_level helper
It accepts va_list argument and suitable to
be wrapped with another helpers.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 14:26:18 +04:00
Cyrill Gorcunov
c406ccc06f log: Make pr_err_once to use pr_err
No need for core duplication.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 14:26:07 +04:00
Cyrill Gorcunov
7dccef3ad4 log: Beautify log.h
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 14:25:59 +04:00
Alexander Kartashov
58f26c8fdd parasite-syscall.c: moved the function mmap_seized() to the file arch/x86/crtools.c
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 14:19:43 +04:00
Alexander Kartashov
9f92cf5acd image.h: moved the macro AT_VECTOR_SIZE to the file asm/types.h
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 14:19:37 +04:00
Alexander Kartashov
58064d9b72 cr: use unsigned long type for integers representing a virtual address
This patch is intended to reduce the usage of the macro P() since
integer size mismatches sometimes may be fixed by this type generalization.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 14:18:59 +04:00
Alexander Kartashov
9209d9eb21 core: introduced the macro CORE_ENTRY__MARCH to represent the target architecture
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 14:17:04 +04:00
Alexander Kartashov
fa1590bb17 restorer: introduced the macro SIGFRAME_OFFSET
The macro is designated to tune the beginning of a sigframe on different architectures.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 14:15:16 +04:00
Alexander Kartashov
446f89ddc5 restorer: introduced the macro RT_SIGFRAME_UC to access the user context of a sigframe
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 14:15:09 +04:00
Alexander Kartashov
46dfd9a001 parasite-syscall.c: introduced the macros REG_RES and REG_IP
The macro REG_RES is to be used to access the syscall return value register
in the struct user_regs_struct_t.

The macro REG_IP is to be used to access the program counter register
in the struct user_regs_struct_t.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 14:14:05 +04:00
Alexander Kartashov
928f1deea3 parasite-syscall.c: introduced the macro ARCH_SI_TRAP
The macro is introduced to abstract from behavior of breakpoints:
they generate different values of the field siginfo.si_code on different architectures.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 14:13:33 +04:00
Alexander Kartashov
b84059a608 multiarch: removed target architecture checks from the following files:
* include/image.h,
* include/syscall-types.h,
* include/restorer.h,
* parasite-syscall.c,
* cr-dump.c,
* cr-show.c,
* pie/parasite.c.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 13:48:07 +04:00
Alexander Kartashov
714cbe701b cr: don't compile the suite for an unsupported architecture
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-14 13:48:05 +04:00
Andrey Vagin
b9645bb5ec zdtm: test shared file tables
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-12 00:55:36 +04:00
Andrey Vagin
979eb2a179 restore: restore pocesses which share one fdtable (v5)
Currenly crtools supports a case when a child shared a fd table
with parent.

Here is only two interesting things.
* Service descriptors should be cloned for each process
  who shared one fd table.
* One task should restore files and other tasks should sleep in this
* time.

v2: * allocate fdt_lock from shared memory
    * don't wait a child, if it doesn't share fdtable
v3: * don't move ids on the pstree image
v4: * save ids in a separate image
    * save fdinfo per id instead of pid
v5: fix alignment of service_fd_id

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-12 00:54:46 +04:00
Andrey Vagin
d50c786c7e files: dump fdinfo per files_id instead of pid
A few processes can share one fdtable.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-12 00:54:44 +04:00
Andrey Vagin
bb25ed38c8 files: close_old_fds before forking children (v2)
A few processes can share one fd table. Each process has own set of
service file descriptors and a process knows nothing about servic fds
of another processes. So if two process share one fd table,
close_old_fds will close servic descriptors of another process.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-12 00:54:42 +04:00
Andrey Vagin
3c8bd5ccd1 pstree: allocate fdt shared data
fdt shared data contains PID of process, which will restore file
descriptors and a futex for synchronization.

A process with mimimal pid restores file descriptors.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-12 00:54:41 +04:00
Andrey Vagin
0ec10e4e16 dump: save ids on pstree_item
It will be used for determing which resources are shared

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-12 00:54:40 +04:00
Andrey Vagin
20b5ed916f crtools: put kobj-ids into separate image file (v2)
It is read together with pstree items for checking what kind of
resources should be shared. Core is too big for reading it in
this place.

v2: fix check_core

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-12 00:54:39 +04:00
Andrey Vagin
4ea6214391 crtools: add ability to create and close a service fd (v3)
A service fd should be created, otherwise get_service_fd returns -1.

This patch removes this functionality from other subsystems and
allows to clone service descriptors.

v2: rename open_service_fd to install_service_fd
v3: two patches were merged for bisecting

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-12 00:54:37 +04:00
Andrey Vagin
e6106956af util: clone service descriptors, if fd tables are shared for tasks (v3)
It looks like a namespace for service descriptors.
It will be used for restoring tasks with shared fd tables.
Service descriptors should be own for each process.

v2: clone_service_fd doesn't know about sub-systems like log, proc, etc
v3: Don't try to find a free name-space.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-12 00:54:36 +04:00
Andrey Vagin
e12dad0ade mntns: close_proc before clean up mounts
Because /proc could not be umounted, if any its file is opened.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-12 00:54:34 +04:00
Pavel Emelyanov
a82cb23f98 pipe: Dump and restore pipe size
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-11 17:45:54 +04:00
Pavel Emelyanov
42d7bc07cb pipe: Make pipe-data entry always be present in the image
It contains info about the pipe itself, not jut one of its
ends. Thus if we want to add more (e.g. -- its size) we'll
have to put it there and thus have it always present.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-11 17:45:52 +04:00
Andrey Vagin
0edb637463 zdtm.sh: detect unrecognized options
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-11 16:51:49 +04:00
Andrey Vagin
49a89764e1 zdtm: add an error message if crtools is absent
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-11 16:51:41 +04:00
Andrey Vagin
07a8647466 lock: add futex_inc_and_wake and futex_wait_while_lt (v2)
v2: fix descriptions

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-11 14:50:44 +04:00
Andrey Vagin
0fc129a121 files: pass a file descriptor on an fdinfo image instead of cr_fdset
Currently fdinfo dumps for each task, so CR_FD_FDINFO is in cr_fdset.
A few tasks can share one fd table and the set of descriptors will be
dumped once and a image name will contain files_id instead of pid.
In this case CR_FD_FDINFO will go away from cr_fdset.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-11 14:47:09 +04:00
Andrey Vagin
dcf158e21d crtools: fix backward compatibility
crtools should not failed, if new images are absent.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-11 11:34:11 +04:00