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

5765 Commits

Author SHA1 Message Date
Laurent Dufour
6eaa4e92bf vdso: merge per arch vdso.c file in a common one
Merge arch/*/vdso.c files in vdso.c.

The merge has been done by copying arch/x86/vdso.c in vdso.c since it
contains patch a67e9f7bb930 ("vdso: don't play with a function exit code").

The commit f9ae6d9dd4e4 ("Replace remaining hard-coded TASK_SIZE use")
pushed in the aarch64 has been replicated since it should be cross
platform.

CC: Christopher Covington <cov@codeaurora.org>
CC: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:07:20 +03:00
Laurent Dufour
94807751aa ppc64: Fix pie Makefile
When building without the vDSO support on PowerPC (which is not a good
idea), the build is failing because few files are not included in the
build.

This fix moves those files inclusion outside of the vDSO directive.

CC: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:07:19 +03:00
Tycho Andersen
7f44f1dbf9 irmap: hardcode some more interesting paths
In ubuntu wily, these paths are inotify'd by various daemons, so we should
watch them as well.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:05:30 +03:00
Cyrill Gorcunov
1a135c48ef docs: Add --freeze-cgroup and update --ext-unix-sk
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:04:26 +03:00
Andrey Vagin
68923c974b test: a static test should do nothing after test_daemon()
Reported-by: Mr Jenkins
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:03:51 +03:00
Cyrill Gorcunov
644c7659e9 kerndat: tcp_max_rshare -- Shrink default size
In commit 664659a0 we defined max possible
values for TCP queues but on low memory
machines (or on machinese whith custom limits
set via sysctl) this trick doesn't work well
all the time. We have to fetch the allowed values
from /proc/sys/net/ipv4/tcp_[wmem|rmem] which
might be simply missing on the environment
we run.

So lets stick with really small values here
got from kernel source code so instead of failing
we would be able to restore in a bit "slower"
than usual.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:02:55 +03:00
Cyrill Gorcunov
64cf10f88e mount: mnt_depth -- make it unsigned
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:02:04 +03:00
Cyrill Gorcunov
f21dfadfe4 mount: mnt_build_ids_tree -- Rework messages
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:00:22 +03:00
Cyrill Gorcunov
795267940c mount: mnt_build_ids_tree -- Rename @p to @parent
The function is too big and @p is too short.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 13:59:42 +03:00
Pavel Emelyanov
f1e8a9ce6b criu: Version 1.7
We have quite a lot of new stuff this time. More flexibility
in cgroup management code (and this story far from being over)
in the library and in the crit command line, preparations to
x66 32bit, that also helped the PPC port, freezer cgroup
filannly found its place in the code. We also had our first
CVE-s found :) and a LOT of bugs fixed.

So the plan for the 1.8 is: cgroups, secured containers and
bugfixes. x86 32bit is tempting too.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
v1.7
2015-09-07 12:26:32 +03:00
Cyrill Gorcunov
a85b54ab54 zdtm: Fix building for @_BSD_SOURCE redefinition
Travis testing engine complained about @_BSD_SOURCE
which is not the case on my build environment.
Anyway lets do a safe thing -- conditional definition.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 22:01:00 +03:00
Cyrill Gorcunov
eb02c8c1fd test: file_locks -- Use device from mountinfo for BTRFS
BTRFS uses own device numbering scheme so lets do a trick
close one to what we have in CRIU itself -- mangle
device to match mountinfo output.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 19:36:27 +03:00
Cyrill Gorcunov
954ba48d1d zdtm: Add filesystem specific helpers
In particular we have to find out if we're
running on btrfs filesystem for proper device
number mangling.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 19:35:59 +03:00
Andrey Vagin
ec31527be1 jenkins: include criu-lib.sh and call prep()
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:46:25 +03:00
Andrey Vagin
50d4d07367 netlink: increase the receive buffer size
Currently the buffer size is 4096. It always works because
we use hosts where PAGE_SIZE is 4096. PowerPC64 has a bigger PAGE_SIZE.

Here is a comment from the kernel code.
/*
 *      skb should fit one page. This choice is good for headerless malloc.
 *      But we should limit to 8K so that userspace does not have to
 *      use enormous buffer sizes on recvmsg() calls just to avoid
 *      MSG_TRUNC when PAGE_SIZE is very large.
 */

We set the buffer size to 16384, because it's the max length of recvmsg()
for this case. We will need less iterations to collect all data, so
the perfomance should be better.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Cc: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:26:51 +03:00
Cyrill Gorcunov
675a84fbc9 mount: Rename get_widest_peer to find_widest_shared
It lookups over shared entries and finds widest.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:23:41 +03:00
Cyrill Gorcunov
f7d550323b mount: Fix comment style
We don't use C99 comments.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:20:52 +03:00
Andrey Vagin
2971fb187f jenkins: add a script to execute tests on PowerPC
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:18:43 +03:00
Andrew Vagin
f20dfbdd95 zdtm: skip linux-vdso64.so when a new root is contructed
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:18:12 +03:00
Andrew Vagin
edd552619e zdtm: fix compilation on PowerPC
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:18:11 +03:00
Cyrill Gorcunov
eb6dcc4070 mount: Fix restore deleted bindmounts for regfiles
- make sure it doesn't exist using O_EXCL
 - don't forget to close it

Reported-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-02 18:51:01 +03:00
Pavel Emelyanov
92fcb8691b Fix compilation after previous commit
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-02 15:53:31 +03:00
Hui Kang
19dbe25918 Skip root cgroup directories when restoring with manage-cgroup=full
Signed-off-by: Hui Kang <hkang.sunysb@gmail.com>
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-02 15:40:59 +03:00
Cyrill Gorcunov
911bb68283 test: mntns_deleted -- Add bindmount for regular files
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-02 15:33:58 +03:00
Cyrill Gorcunov
d27f5391d5 mount: Handle deleted bindmounts for regular files
1) Deleted bindmount for files should be restored
   by creating temp file. The kernel doesn't permit
   to mix bindmount in terms of file/dir relationship:
   either both source and target should be files or
   directories.

   Thus we can call stat on the target and figure out
   what kind of source we had.

2) Even for deleted entries better to use permissions
   from the target's stat call, this makes result close
   to how would it look if program hadn't been checkpointed.

Reported-by: Andrey Wagin <avagin@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-02 15:33:46 +03:00
Andrew Vagin
bee835ebeb zdtm/file_locks01: fix testing devices
Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-02 13:18:28 +03:00
Andrey Vagin
4b0c0c5828 zdtm/file_locks03: don't use pipe for synchronization
Reported-by: Mr Jenkins
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-01 15:20:36 +03:00
Andrew Vagin
2ce6a6a2af file_locks02: don't use pipe for synchronization
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-01 13:14:06 +03:00
Laurent Dufour
f2bc172f67 ppc64: fixing build issue
The commit 69d008d56788 ("Use run-time page_size() for mremap")
introduces the use of dynamic page size in rst-malloc.c.

The commit also add the include of unistd.h in
arch/aarch64/include/asm/page.h to allow the build to succeed on this
architecture.  Since ppc64 is also using the same way to deal with page
size, the same include is required in arch/ppc64/include/asm/page.h

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
CC: Christopher Covington <cov@codeaurora.org>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-01 12:30:56 +03:00
Andrey Vagin
83f79c7e8c ptrace: print error code for PTRACE_DETACH
*** CID 139494:  Error handling issues  (CHECKED_RETURN)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-01 12:26:03 +03:00
Andrey Vagin
35ec944304 file: reserve one byte in a string buffer for the null byte
*** CID 139492:  Memory - illegal accesses  (BUFFER_SIZE_WARNING)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-01 12:25:39 +03:00
Andrey Vagin
f62fd61709 seize: fix used after free case
*** CID 139496:  Memory - illegal accesses  (USE_AFTER_FREE)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-01 12:25:33 +03:00
Andrew Vagin
8189eda7b9 zdtm/file_locks1: compare devices in addition to inodes
You can see two equal inode numbers with differen devices and
it was a reason why the test failed.

4: C: 12491/12495/12496
4: c: 1: POSIX  ADVISORY  WRITE 0 fc:03:12468 0 EOF
4: c: 2: POSIX  ADVISORY  READ  0 fc:03:12421 0 EOF
4: c: 3: POSIX  ADVISORY  WRITE 0 00:14:16285 0 EOF
4: c: 4: FLOCK  MSNFS     READ  4 fc:03:12496 0 EOF
4: c: 5: FLOCK  ADVISORY  WRITE 4 fc:03:12495 0 EOF
4: c: 6: FLOCK  ADVISORY  READ  4 fc:03:12491 0 EOF
4: c: 7: POSIX  ADVISORY  WRITE 0 00:14:16280 0 EOF
4: c: 8: POSIX  ADVISORY  WRITE 0 00:14:12677 0 EOF
4: c: 9: FLOCK  ADVISORY  WRITE 0 00:14:12520 0 EOF
4: c: 10: FLOCK  ADVISORY  WRITE 0 00:14:12495 0 EOF
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 16:01:40 +03:00
Andrey Vagin
439de67a4b test/rpc: don't use the shell_job option
It isn't required.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 16:00:37 +03:00
Andrey Vagin
5075f278f6 test/rpc: don't call criu_resp__free_unpacked for NULL
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 16:00:29 +03:00
Andrey Vagin
bba4000c40 test/rpc: import the errno module
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 16:00:20 +03:00
Andrey Vagin
31475ffa6d test/rpc: track changes of the criu binary
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 16:00:13 +03:00
Andrey Vagin
f837310e13 zdtm/fdt_shared: wait until children finish the preparation stage
Reported-by: Mr Jenkins
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 15:59:59 +03:00
Cyrill Gorcunov
e6e56a6294 test: mount -- Add simple testcase for deleted bindmounts
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-21 21:26:25 +03:00
Cyrill Gorcunov
80ef8fd2fb mount: Handle deleted bindmounts
To handle deleted bindmounts we simply create
the former directory bindmount lived at, mount
the target and remove the directory back.

For this sake we add @deleted entry into the image.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-21 21:26:17 +03:00
Cyrill Gorcunov
60f6ec7dd6 files-reg: Rework strip_deleted helper
Make it handle both postfixes and return
non-zero code if stipping happened.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-21 21:26:01 +03:00
Cyrill Gorcunov
4f8f97e0bd mount: mount_info -- Drop unused @is_file
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-21 21:25:14 +03:00
Andrey Vagin
311e927b5c test: execute other tests in a new session
The main reason is to execute tests without a control termnal and avoid
a case when tests try to use the --shell-job options.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-21 21:13:47 +03:00
Andrey Vagin
ad80227a37 test/mem-snap: wait util a zdtm test isn't stopped
before checking results.

Reported-by: Mr Jenkins
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-21 21:13:43 +03:00
Tycho Andersen
0ac4c13e60 fix typo
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-18 18:17:58 +03:00
Cyrill Gorcunov
40ed330c88 kcmp: Stop showing ids tree
Useless, at least in the form present
now it's unreadable anyway. So stop
welling out the logs.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-18 18:17:31 +03:00
Cyrill Gorcunov
db70a415ed mount: propagate_mount -- Add braces
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-18 18:15:50 +03:00
Saied Kazemi
91a82fde71 Add OverlayFS support to docker_cr.sh
The main purpose of this patch is to add OverlayFS support to docker_cr.sh
for external checkpoint and restore.  It also does a bit of cleaning
and minor enhancements.

Signed-off-by: Saied Kazemi <saied@google.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-18 18:14:32 +03:00
Cyrill Gorcunov
5c18267ddf proc-parse: Fix line merging
Seems was a typo.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-13 17:18:19 +03:00
Cyrill Gorcunov
8c9e15560a mount: Shrink lookup_nsid_by_mnt_id
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-13 17:18:09 +03:00