IPC shared memory data is aligned by 32 bits.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We have 3 calls for that, two called directly from cr-restore,
one -- from one the former. Clean this mess and write short
comments on each stage.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This thing on pstre_item was created to carry task-specific
information across the "restore" code-flow.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The watch target might be a deleted file. In this case we can't
re-create it on restore procedure.
A typical scenario
------------------
fd = inotify_init1()
wd = open(path)
inotify_add_watch(path)
unlink(path)
... checkpoint ...
here we have a @path which is unlinked but still present in inotify
watch list because inode is not yet freed. And if the program is killed
after checkpoint the last reference to a path get eliminated and inode
get freed from the kernel memory.
Thus any furher attempts to open the path via file handle (note that file
handle can't be used to create new file, the kernel doesn't permit that)
will simply fail.
So if plain opening via file handle failed we assume that at least
the file might be in our ghost files list (we're optimists, right?)
and if we successed we simply use a path generated by ghost file
engine for us.
v2 [by xemul@]:
- gather reference to ghost file remap early
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Because we need to lookup for ghost files from
inotify system where we only have device/inode
as a key, we save dev/ino in ghost image entry.
Note we use in-kernel format for device to be
consistent with inotify and mount related
code base.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The remap_put will be needed to defer unlinking of ghost files
if they are referred from inotify system.
The lookup_remap is needed to figure out if the watch
target the inotify has present in ghost files list.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Since fdinfo patches were merged to -mm
tree the output format has been slightly
changed. So update our tool accordingly.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
A value of signo is in [1, SIGMAX].
Currenly signals are enumirated from 1 to SIGMAX, but SIGMAX
is not included. This patch fixes this mestake.
v2: * save backward compatibility
* set a correct value of SIGMAX = 64. It can not be in a
separate patch, because a format is changed again.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
When resetting nr_in_progress for next stage no need
in waking up anyone. Nobody waits for it yet :)
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Switching to a new stage is 4-step procedure which
deserves its own helper. Besides, now the information
about how many tasks participage in each stage is
collected in one place.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
When finishing a stage we have to report this (decrement the
number of tasks in stage) and wait while stage switch. Write
a helper that does both.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Content of /proc/$pid/auxv declared as array of long and this file hasn't compat layer.
https://jira.sw.ru/browse/PSBM-16280
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
If you have an error in parasite.c and execute make from vim,
without this patch vim opens a new file parasite.c in a root directory.
With this patch vim opens pie/parasite.c.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This patch adds check for "/proc/sys/kernel/sem_next_id" to make sure, that
kernel supports restore of IPC objects.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Old interface with modified IPC syscalls is deprecated is replaced sy sysctls.
This patch updates CRIU to use new interface.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
* add exclude list. Tests from this list are executed only on C/R kernels
* check that a version of a kernel is greater than 3.7
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
A error message is printed.
We want to save ability to try crtools on non C/R kernel.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This function prints an error message only once.
[xemul: change ({}) to do {} while (0)]
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Same as eventpoll -- we might have no watchee assigned
but only inotify descriptor created.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This reverts commit ef3771d566dacb8ee9fe71b744d56f08674fe3db.
With new SO_BINDTODEVICE getting API it's not required.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The SO_BINDTODEVICE getter is changed in the kernel (before
official release) to report not index, but name to be in
harmony with setter.
Fix crtools accordingly.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>