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

2322 Commits

Author SHA1 Message Date
Pavel Emelyanov
86c848e186 rst: Remove unused extern fns declarations
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-13 20:52:40 +03:00
Pavel Emelyanov
e6617b5e2e parasite: Macro for getting parasite symbols
Same as previous patch -- easier to read and possible
to use tags.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-13 20:51:32 +03:00
Pavel Emelyanov
f86bbe6a9c restore: Introduce a macro to get restorer symbol address
This makes code more readable, saves one ptr on stack and
lets us jump into restorer code using tags.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-13 20:15:13 +03:00
Pavel Emelyanov
23bf4faa0d check: Set error log level before checking
Not to spoil screen with false warnings.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 17:04:24 +03:00
Cyrill Gorcunov
54148db18f zdtm: Add new pthread01 test
To test threads blocked signals restoration.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 17:43:02 +04:00
Cyrill Gorcunov
2ee5a42f3e restore: Add restoration of the blocked threads signals from the image
To unify the code for both thread leader and regular threads
we move blocked signals for thread leader into threads argument
area and use restore_thread_common() helper.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 17:43:01 +04:00
Cyrill Gorcunov
5da22b01fe dump: Fix message in thread dumping
And add missing new line in message.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 17:42:59 +04:00
Cyrill Gorcunov
7266efdec5 dump: Show blocked signals when dumping
For debug purpose.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 17:42:58 +04:00
Cyrill Gorcunov
5b7e3b8dae dump: Checkpoint per-thread blocked signals
I've moved dump_thread helper a bit lower in file
since I've to call for find_thread_state helper.
After all this groups all thread related functions
in one slab.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 17:42:56 +04:00
Cyrill Gorcunov
f107e8e9e2 dump: Save and remove per-thread argumens in parasite
This patch starts using parasite_init_threads_seized and
parasite_fini_threads_seized helpers to save per-thread
data in parasite and remove it on cure procedure.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 17:42:55 +04:00
Cyrill Gorcunov
80928f8c1b parasite: Declare @tid as pid_t in parasite_dump_thread
Just to be consistent with types we're using.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 17:42:54 +04:00
Cyrill Gorcunov
c8754da9ae parasite: Rename parasite_dump_tid_info to parasite_dump_thread
We will need to extend the structure to keep not only tid/tid_addr
but blocked signals as well, thus rename it to more generic
parasite_dump_thread.

The command PARASITE_CMD_DUMP_TID_ADDR renamed to
PARASITE_CMD_DUMP_THREAD for the same sake.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 17:42:53 +04:00
Cyrill Gorcunov
9dc332a593 parasite-syscall: Add parasite_[init|fini]_threads_seized helpers
We will use them from crtools code to save and restore blocked
signals mask of threads.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 17:42:51 +04:00
Cyrill Gorcunov
98544842ac parasite: Switch parasite thread leader to use thread helpers
- the init() now calls for init_thread() to save blocked
   signals mask in per-thread data

 - the fini() now calls for fini_thread() to restore the
   blocked signals, note: we could use thread_leader directly
   but i think calling for fini_thread() is more generic

 - dump_misc() now uses per-thread data

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 17:42:50 +04:00
Cyrill Gorcunov
e441109efa parasite: Add [init|fini]_thread helpers
These helpers will be needed to save a blocked signals
mask for dumpee threads.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 17:42:49 +04:00
Cyrill Gorcunov
616b96421e parasite: Rework init/fini to reserve/free space for per-thread data
The per-thread information requires own space in parasite data.
In particular we will keep the blocked signals bound to thread
pids.

For this sake the caller need to provide the parasite how many
threads will be used to calculate space.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 17:42:48 +04:00
Cyrill Gorcunov
4be701794e protobuf: Add @blk_sigset to thread_core_entry
It will hold the blocked signals for threads.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 17:42:47 +04:00
Cyrill Gorcunov
9a5b427470 restore: check_core -- Add missing test for thread_info in non-zombie task
Otherwise we might get nil dereference in sigreturn restore.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 12:35:03 +04:00
Cyrill Gorcunov
475aa87225 restore: check_core -- Move core->ids check under separate if() statement
We will need to extend non-zombie tests.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 12:34:56 +04:00
Cyrill Gorcunov
71a65a96f5 zdtm: Update futex-rl test for thread leader
Don't forget to test thread leader as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 12:33:53 +04:00
Cyrill Gorcunov
300d2f2626 protobuf: Drop dangling \Space
No func change.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-11 13:28:59 +04:00
Cyrill Gorcunov
058d83b464 protobuf: Return -1 on error in do_pb_read_one
Better to stick with the convention we're trying
to follow in general -- negative codes for error.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-11 13:28:25 +04:00
Pavel Emelyanov
6b2e13fcd9 proc: Fix anon shmem mapping detection
Linux kernel emulates anon-shared mappings by mapping internal
tmpfs file in. We try to detect this by checking that the file
under map is such, but do it with error -- major == 0 check is
wrong, as regular tmpfs file can be such as well as btrfs or
ecryptfs can screw things up.

The only working way of doing this is to get the dev_t of this
internal tmpfs mount.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-06 19:07:38 +03:00
Cyrill Gorcunov
bbf33fa68f parasite: Print error code in parasite_dump_tty
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-06 18:18:31 +04:00
Cyrill Gorcunov
5e8816796b parasite: Make init() to return negative error code
Fix a few places where positive value returned as an error sign.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-06 18:18:23 +04:00
Cyrill Gorcunov
89ab7f9fa5 parasite: Return error is write failed
Fix a typo.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-06 18:18:11 +04:00
Cyrill Gorcunov
03d448f047 parasite: Switch should_dump_page to boolean
It's a predicate function, boolean value is more appropriate here.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-06 18:17:16 +04:00
Andrey Vagin
dc3a08c80b zdtm: Add static/socket-tcpbuf enabled by default
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-06 18:14:01 +04:00
Vladimir Davydov
8a496c860a zdtm: allow possix timers overrun be greater than time passed
During live migration timer overrun can jump forward too.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Stanislav Kinsbursky <skinsbursky@openvz.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-06 16:57:42 +04:00
Cyrill Gorcunov
eadf6d4eab parasite-syscall: Don't invert the sign of parasite return code
This sneaked during parasite error handling code rework.
When parasite returned negative error code we should not
invert it.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-06 16:56:55 +04:00
Stanislav Kinsbursky
eee14340e3 protobuf: skip show of zero-size repeated fields
Print "<empty>" message for such filed instead.

#2425

Signed-off-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-06 16:46:42 +04:00
Cyrill Gorcunov
c237a720b1 libnetlink: Make sure there is no error happened when dumping is done
If the kernel is misconfigured (say UDP diag module is not set)
we should detect such situation and report an error.

This patch adds a test for error code. Note the kernel requires
a patch as well. Without kernel patch this test do not harm
anyway, thus safe to merge.

#2412

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-06 13:41:36 +04:00
Cyrill Gorcunov
7de965260e log: Don't show time stamp on pr_msg
In case if the pr_err happens before pr_msg,
the string buffer will have dangling timestamp
prefix. Skip it here.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-06 13:37:15 +04:00
Andrey Vagin
c80b08643f zdtm: print string describing error number
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 17:43:59 +04:00
Andrey Vagin
a943071e44 tty02: open a slave tty with O_NOCTTY
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 17:43:30 +04:00
Andrey Vagin
e6bd325845 zdtm: fix a error message
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 17:42:48 +04:00
Pavel Emelyanov
64a4c40083 check: Check for ability to get socket filter
This is required to work with tcpdump.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 16:07:56 +03:00
Pavel Emelyanov
d4735a22fa packet: Support mmap-ing of packet sockets
Three parts.

Proc: open of map_files' link doesn't work on sockets. We fstatat
it and check that it's a socket (it will be packet), then save
the socket inode on vma_area.

Dump: we resolve socket inode to socket id and save it on vma.
We use id, not inode, since on restore we'll have to mmap some
opened file, not just abstract socket with inode.

Restore: when reading vma-s we just need to find out on what fd
the respective packet socket is opened (i.e. -- no map-and-close
sockets supported by now) and dup() it to let restorer mmap it
back.

All this make it possible to c/r the tcpdump tool!

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 16:00:18 +03:00
Pavel Emelyanov
a385c6fa8d rst: Print more debug when pre-opening vma-s
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 15:59:20 +03:00
Pavel Emelyanov
1fe795c5ca restorer: Print debug when calling mmap-s on new mappings
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 15:57:56 +03:00
Pavel Emelyanov
3246f2399a util: Fix vma shmid printing format
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 14:46:51 +03:00
Pavel Emelyanov
caca5daa84 proc-parse: Fix mapping address print format
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 13:53:21 +03:00
Andrey Vagin
1eb2212530 unix: restore file params and sockopts for all standalone sockets
We can have a situation, when a socket is bound, but isn't listen yet.

I can't find a situation, when we should not restore parameters.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 14:38:48 +04:00
Andrey Vagin
4c60b22d75 zdtm: check unconnected unix sockets
https://bugzilla.openvz.org/show_bug.cgi?id=2408

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 14:38:35 +04:00
Andrey Vagin
e5a8065713 unix: don't restore name for unix stream established sockets
A stream socket may be bound, but is not listen yet.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 14:37:45 +04:00
Andrey Vagin
434c107d7c unix: allow to dump closed sockets
Looks like it can be restored already.

#2408

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 14:37:33 +04:00
Cyrill Gorcunov
1c35b31d8d parasite: Drop deprecated comment
It's no longer true, we've deresigned the parasite
pretty time ago.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 14:34:03 +04:00
Cyrill Gorcunov
ae84dc817d parasite: Drop void* conversion noise
No need for explicit conversion here. It simply brings more noise.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 14:33:45 +04:00
Cyrill Gorcunov
11df96b407 parasite: Drop dead code
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 14:33:28 +04:00
Huang Qiang
1e93a46e9b crtools: update the usage message for log level
We have more than 2 levels right now, update the usage message.

Signed-off-by: Huang Qiang <h.huangqiang@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 13:45:25 +04:00