It's need to add -Wno-unused-result option to lib and
static Makefile to avoid errors like:
msg.c:58:8: error: ignoring return value of 'write', declared with
attribute warn_unused_result [-Werror=unused-result]
Signed-off-by: Victor Konyashkin <vkonyashkin@parallels.com>
Acked-by: Andrey Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The mode argument must be supplied when O_CREAT is specified in flags.
Otherwise it will cause compile error due to -Werror is specified.
Signed-off-by: Viktor Konyashkin <vkonyashkin@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The testcase is buggy -- the signal is delivered _before_ we checkpoint
and restore it, thus it checks nothing. But after the fix test fails,
due to bug in fowners restore. Will fix it later.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Otherwise this memory are initialized from parent and child,
but parent may initialize, when a child has written a useful data.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Otherwise waitpid returns -EINTR and the test case fails.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Otherwise I see output like
| Dumping path for 1536412160 fd via self 27 [/usr/bin/screen]
where fd is taken from stack and what is worse -- we work
with root privilegues, thus dumping _anything_ from stack
is very bad idea.
With explicitly cleared stack data and FD_DESC_INVALID the
log file will have an entry like
| Dumping path for -3 fd via self 27 [/usr/bin/screen]
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This will allow to implement tty dumping
in future.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It's really confusing when one use -o option
and didn't see update on top of log file.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This eliminates the warning below as well
| pipes.c: In function ‘open_pipe’:
| pipes.c:252:6: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable]
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
to fix warning "error: ‘XXXXXX’ defined but not used"
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The global variable me isn't initialized, when we tried to use it.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The proc_parse file turns into a strange pile of homebrew
scanf/fgets/strtok/strchr/etc. combination. I don't like it :(
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We'll have to parse it all and the format is not scanf
friendly, so it's simpler to have it in a separate fn.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Make the proc_mountinfo obtaned after parse form a single linked list.
That's much easier to handle and doesn't have an artificial limitation
of 64 items...
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Otherwise it shows nothing without the verbose option
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
What is stored there is the path to mountpoint. The root
is the field previously named "parent root".
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
In case if eventpoll or inotify just created but
not watchee added we should not fail.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
While been playing with sockets dumping I found a case where
we exit without descriptive error message. Fix it.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Those sitting on the SOL_SOCKET level are common to different
socket families and will be handled in a generic code.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Since event polling depends on other files
to be opened we split main files list into
two parst -- event poll files and all other
files, thus defer the creation of eventpoll
files in prepare_fds().
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
If the option --log-pid is set, each process will have an own log file.
Otherwise PID is added to each log message.
A message can't be bigger than one page minus some bytes for pid.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It will fall through all the other checks, but let's do it
explicitly for better code understanding.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This saves some space on dynamic file_desc and makes file_desc_ops
looks closer to fdinfo_ops used on dump.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
No functional changes, just a code move.
TODO:
* need to write personal make_gen_id implementations for special
files (device and pos is const for them effectively)
* need to merge dump ops with restore ones (file_desc_ops)
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Reg files are those obtained by open() syscall on restore.
Pipes should be checked to belong to pipefs (fifos are not supported
yet).
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>