The description of the syscall mincore breaks
the traditional ordering of syscall descriptions.
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This patch modifies the ARM syscall glue as follows:
* the macros syscallX that produce different code
for syscalls with different number of arguments
are replaced by the generic syscall thunk copied
from libc;
* the syscall tables generation script is simplified
since the syscall argument number analysis is redundant;
* the ARMv7 specific instruction MOVW is eliminated.
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This patch modifies the build system to analyze the version
of the target ARM architecture and setup the compiler flags
accordingly. This makes it possible to support the ARM
architectures prior to ARMv7.
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Actully for dumping tmpfs it should be remounted to somewhere else to
avoid overmounts.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
- include "protobuf/core.pb-c.h" for CoreEntry definition
- gather structure predeclaration on top
- move general comment on top as well
- add extern for construct_sigframe helper
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Will need it to retrieve signal stack parameters.
Note for simplicty I declared the syscall having
void * arguments, while libc has it as stack_t *.
This need to be cleaned up one day (because
we use similar structure for sigframe definition
and need to merge both definitions down).
ARM syscall def from alekskartashov@
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It's not arch dependent by any means, thus it looks
strange that we allocate it in arch/ but free in
pstree.c.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
- We have a convention to return -1 on error
- Drop empty line
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Make criu still set scheduler and priority on restored process even
when its setting is the default one. Or if criu itself has special
setting on it, forked processes will inherit it, which is a wrong setting
for restored ones.
Signed-off-by: Yicheng Qin <yichengq@google.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Number of rlimits may vary depending on system version
criu is compiled against. So we use rst-allocator to
carry all limits read from file.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The memory in question is allocated and then remaped into
restorer with one call to mremap. Thus, to use the mem we
need to provide to users API for
* alloc memory
* get current allocation pointer
* convert current pointer into remapped one
* the remap itself
This would help combinding lots of small allocations such
as tcp sockets to unrepair, siginfos and posix timers.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
timer is not freed in case of eof.
CID 1042301 (#1 of 1): Resource leak (RESOURCE_LEAK)
15. leaked_storage: Variable timer going out of scope leaks the storage it points to.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
CID 1042292 (#1 of 1): Unsigned compared against 0 (NO_EFFECT)
unsigned_compare: This less-than-zero comparison of an unsigned value is
never true. "len < 0UL"
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Before doing something with mounts they should be marked as private,
otherwise our actions can affects someone else.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
If a parent mount point is shared with exteranl mntns, a child will be
umounted from the external mntns too.
For example:
$ mount -t tmpfs xxx /root/tmp/
$ mount --make-shared tmp
$ mkdir tmp/xxx
$ mount -t tmpfs xxx /root/tmp/xxx
$ touch tmp/xxx/a
$ unshare -m umount tmp/xxx
$ ls -l tmp/xxx/a
ls: cannot access tmp/xxx/a: No such file or directory
This patch changes a parent mnt to private for umounting childrens.
v2: exit if a mount point can not be marked ad private
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This most likely meand, that the respective -diag module is missing.
In that case the caller would check it and _might_ not fail the dump
at once. Thus treat it as error.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This file was created for backward compatibility with
not-yet-patched kernel. Now we can remove it.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Unix socket and have no peer, but be in established state.
Such types of sockets appear when one end of a connection
closes and leaves the peer in full-shutdown state.
Check this and handle properly on restore.
Reported-by: Florian Gross <Florian.S.Gross@web.de>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This release goes on increasing the bugfix-to-features
ratio. Though we still have a lot of new stuff in the tool
the amount of bugs we've caught and fixed increases.
As a very notable feature it's worth mentioning that we
have prepared crtools to be ready to restore images,
converted from those generated by rh6-openvz kernel, i.e.
we are very close to have live-migration from rh6 to
whatever-it-will-be as the next openvz kernel.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
1st stage is -- creating the timers. It may fail if kernel
allocated IDs in a manner we don't expect or runs out of
memory.
2nd stage is -- arm the timers. It cannot fail, since we've
validated the timespecs in advance and should happen after
we've waited for all the other tasks to complete the restore.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We've slightly updated -v option argument parsing,
thus update cmdline used in a few app-emu tests.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Add cpt/rst timeout to inaccuracy.
All timers are stopped during cpt/rst. We don't know in which moment
they are stopped and run, so this timeout is added to acceptable
inaccuracy.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>