We have a mess in our return codes:
some functions return negative values,
while others -- positive.
Sanitize the return codes and make error
condition to return negative values.
Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
If a process continue to run, it may change a state of filesystem.
@gorcunov:
- Drop -k option, it's not needed anymore.
- Allow -c option (continue execution of a
process after being dumped) in dumping procedure.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
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>
Added
- ability to parse every single file crtools
understands via magic number
- dumped memory pages can be rendered in two
modes -- as a simple set of pages' virtual addresses
or in hexdummp fashion (via -c command line key).
For example
./crtools -s -c -f pages-2557.img
CR_FD_PAGES: pages-2557.img
----------------------------------------
7fffb44ace20: 00 00 00 00 00 00 00 00 00 00 00 74 65 73 74 2f |. . . . . . . . . . . t e s t / |
7fffb44ace30: 74 65 73 74 2d 73 69 67 61 63 74 69 6f 6e 00 48 |t e s t - s i g a c t i o n . H |
7fffb44ace40: 4f 53 54 4e 41 4d 45 3d 6c 6f 63 61 6c 68 6f 73 |O S T N A M E = l o c a l h o s |
7fffb44ace50: 74 2e 6c 6f 63 61 6c 64 6f 6d 61 69 6e 00 54 45 |t . l o c a l d o m a i n . T E |
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
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>
A parasite code dumps all sigactions in sigact.pid.
v2: remove hard code for sizeof(sigset_t)
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
We will need more options since the
tool should support both cgroups freezer
and a regular task stop/dump/restore/continue
transition.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>