2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00

81 Commits

Author SHA1 Message Date
Pavel Emelyanov
e710c5c5ef crtools: anitize showing funtions
Remove unneeded path argument (we do know the file data is read from) and
actually bogus show_header boolean.

Also introduce two helpers for showing header and tail.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-12 18:50:59 +04:00
Pavel Emelyanov
0ca9ccc3e4 crtools: Sanitize the tasklist states switch
Introduce a helper for walking the list and sending signals.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-11 13:59:15 +04:00
Cyrill Gorcunov
00e14f0448 make: Add DEBUG=1 option
This allows to use pr_debug and dprintk helpers.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-27 02:28:12 +04:00
Cyrill Gorcunov
4c0fb12e11 util: Make pr_warning to report file and line as well
For easier debugging. We can zap it at release time.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-27 02:28:02 +04:00
Pavel Emelyanov
bf7a74d47e Helper for moving image fd
When opening an fd at a position where the current image fd sits
the latter one should be moved.

Introduce a helper for this.

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

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-26 21:53:44 +04:00
Cyrill Gorcunov
f5a87742a0 util: Add BUG_ON helper
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-26 15:54:03 +04:00
Cyrill Gorcunov
3e45e04050 util: Add fopen_fmt helper
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-26 02:24:27 +04:00
Cyrill Gorcunov
2e3c4e3692 Move everything related to ptrace into ptrace.[ch]
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-19 21:57:59 +04:00
Cyrill Gorcunov
83fd63d3fe Add missing extern to function prototypes
Regardless that we link all things in one executable
better declare them so from the very beggining.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-19 21:46:03 +04:00
Cyrill Gorcunov
32ac78a499 util: Drop ptrace seize helpers declaration from the header
Already defined in seize.h

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-19 21:19:28 +04:00
Cyrill Gorcunov
d6eab944e3 Move logging functions to log.c
Instead of keeping all unrelated to
C/R procedure helpers in util.c move
logging related helpers to log.c.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-19 18:52:50 +04:00
Cyrill Gorcunov
dc883fe49f util: Drop unused inline_memcpy
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-19 16:13:04 +04:00
Andrey Vagin
650318f4b2 crtools: add options to specified a log file
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-08 18:55:13 +04:00
Andrey Vagin
d261cf7958 Use absolute path for image files
Now I try to restore CWD and a relative path will be invalid.

Add new options -D to set image files directory.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-07 17:16:37 +04:00
Andrey Vagin
2c237b6973 Don't use standard descriptors for logging
The standard descriptors may be redirected.

crtool dumplicates stderr in rlimit.maxfileno-1 and this descriptor
is inherited by all children and will be closed before sigreturn.

Known issues:

 - The logging descriptor may be used by a target process and
   a resume will fail.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-05 12:07:52 +04:00
Cyrill Gorcunov
9eeb003766 util: Add K/M/G bytes helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-24 15:07:03 +04:00
Cyrill Gorcunov
122cae2111 dump: Add -k (kill dumped) option
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-22 22:09:28 +04:00
Cyrill Gorcunov
0fd17a08cb Bring some order in usage of VMA entries helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 17:12:29 +04:00
Cyrill Gorcunov
35781a8c6d util: Drop redundant vma_area->vma.status assignment
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 13:37:17 +04:00
Cyrill Gorcunov
2cc7488de2 dump: Make VMA parsing to handle absence of map_files
Needed in testing purposes. Also make free_mappings
being a global one (will need it in restorer).

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-26 22:48:10 +04:00
Cyrill Gorcunov
fa56125d16 util: Move memcopy helper into the header
Since we will need it in parasite and restorer
code rename it to inline_memcpy to avoid name
collision.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-26 18:05:32 +04:00
Cyrill Gorcunov
0d20dd0b41 util: Add hex_dump helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-26 10:10:19 +04:00
Cyrill Gorcunov
ea0f8eac1d util: Add open_fmt_ro helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-24 13:56:03 +04:00
Cyrill Gorcunov
f8ad351f4d util: Make open_fmt being more general
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-24 13:51:41 +04:00
Cyrill Gorcunov
26857cc4e5 util: Move various helpers there
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-24 13:43:21 +04:00
Cyrill Gorcunov
6c4798fd44 util: Rename objzero to memzero_p
More natural name

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-23 12:30:28 +04:00
Cyrill Gorcunov
5f53dc21d9 util: Change read_safe_eof and introduce objzero and memzero
Should be more convenient to use

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-23 12:30:17 +04:00
Cyrill Gorcunov
a0e37e779d util: Add xstrdup helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-23 12:01:39 +04:00
Cyrill Gorcunov
a00ef142f8 Use pr_err for error printing
To follow kernel style

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-09-30 14:37:12 +04:00
Cyrill Gorcunov
401464d22a Add close_safe helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-09-27 18:28:09 +04:00
Cyrill Gorcunov
523de23624 Initial commit
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-09-23 12:00:45 +04:00