2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-28 21:07:43 +00:00

7582 Commits

Author SHA1 Message Date
Dmitrii Shcherbakov
1cadd1c3e8 zdtm:mnt_ext_dev: output a message if ZDTM_MNT_EXT_DEV is not set
Should be easier to debug if the variable is not passed by accident.

travis-ci: success for series starting with [1/2] zdtm:mnt_ext_auto: avoid segfault if ZDTM_NEWNS is not set
Signed-off-by: Dmitrii Shcherbakov <dshcherbakov@virtuozzo.com>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:22:23 +03:00
Dmitrii Shcherbakov
99e77674a2 zdtm:mnt_ext_auto: avoid segfault if ZDTM_NEWNS is not set
If getenv returns a null pointer we get a segfault here.

Let's exit in a more sane way.

travis-ci: success for series starting with [1/2] zdtm:mnt_ext_auto: avoid segfault if ZDTM_NEWNS is not set
Signed-off-by: Dmitrii Shcherbakov <dshcherbakov@virtuozzo.com>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:22:23 +03:00
Mike Rapoport
df335ee182 pagemap: seek_pagemap_page: drop warn parameter
Move error printouts to the call sites to keep "fast path" clearer.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:22:22 +03:00
Mike Rapoport
4b954b94e4 pagemap: remove debug print in skip_pagemap_page
It seems that logging amount of skipped pages was useful for early
debugging of pre-dumps, but now it just creates a lot of noise for lazy
pages and pre-dump tests.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:20:24 +03:00
Kir Kolyshkin
3c18e39660 test/zdtm: pr_perror() sanitization
Don't append \n as pr_perror() already does it for us.

travis-ci: success for more pr_perror() usage fixes
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:19:48 +03:00
Kir Kolyshkin
4d1c3f9834 test/zdtm: use pr_err() not pr_perror
In places where we are not supposed to print errno, or where
we already print in explicitly, use pr_err().

travis-ci: success for more pr_perror() usage fixes
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:19:48 +03:00
Kir Kolyshkin
bdf60512de pie: provide memcpy/memcmp/memset for noglibc case
Use alias function attribute to provide memcpy(), memcmp()
and memset() in case we're not linking with libc. This is
needed as compiler can generate calls to those functions
(clang actually does that).

[v2: add comment, move aliases to under HAS_BUILTIN_*]

https://travis-ci.org/kolyshkin/criu/builds/174634847
Idea-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:19:02 +03:00
Kir Kolyshkin
f845d9e4e0 builtin_{memcpy,memset}: make compatible with libc
1. memcpy() last argument is size_t
2. memset() returns void *

Make our builtin_*() functions compatible.

https://travis-ci.org/kolyshkin/criu/builds/174634847
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:19:02 +03:00
Pavel Emelyanov
f851da768c pie: Split parasite_service into pieces
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:19:02 +03:00
Pavel Emelyanov
056786376b pie: Split parasite_fini into pieces
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:19:02 +03:00
Pavel Emelyanov
0e1cce76b0 pie: Split parasite_daemon into pieces
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:19:02 +03:00
Pavel Emelyanov
6e4c1d9f05 zdtm: Split long .desc lines
Done with python pprint module (indent = 4, width = 80)
for files with more than one field in and with length
exceeding 80 characters.

Travised-by: https://travis-ci.org/xemul/criu/jobs/171350152
travis-ci: success for zdtm: Split long .desc lines
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:19:01 +03:00
Cyrill Gorcunov
ef73a7f2a6 criu: lock -- Use systemwide uintX types
For portability sake, we gonna share this header.

travis-ci: success for Common headers
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:19:01 +03:00
Dmitry Safonov
c1e3977935 parasite/x86: introduce&use builtin_memset
Don't use compiler-provided memset in parasite.

Fixes: commit 86434deba0b4 ("x86: dump TLS entries from GDT").

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:18:56 +03:00
Cyrill Gorcunov
7b8b418edf build: nmk -- Filter out -Wl flags from linking builtin targets
Tycho reported that Debian uses custom LDFLAGS to
build criu, this flag get propagated into built-in
targets where we use $(LD) instead causing build
procedure to interrupt

|  LINK     arch/x86/syscalls.built-in.o
| ld: unrecognized option '-Wl,-Bsymbolic-functions'
| ld: use the --help option for usage information
| /«PKGBUILDDIR»/scripts/nmk/scripts/build.mk:141: recipe for target 'arch/x86/syscalls.built-in.o' failed

Lets make maintainers life easier and filter
out the flags we know never accepted by $(LD).

Reported-by: Tycho Andersen <tycho.andersen@canonical.com>
Tested-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:17:31 +03:00
Dmitry Safonov
ffe90e0b9e parasite: convert sigframe to u64
Sigframe pointer should be fixed size.
Convert members of rt_sigframe_ia32 to fixed-size.
After this patch dumping of compatible tasks works.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:17:30 +03:00
Andrei Vagin
ccc4456474 zdtm: move a tap header to a first line
org.tap4j.parser.ParserException: Error parsing TAP Stream: Invalid position of TAP Header.
It must be the first element (apart of Comments) in the TAP Stream.

Reported-by: Mr Jenkins
travis-ci: success for zdtm: move a tap header to a first line
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-19 20:58:40 +03:00
Pavel Emelyanov
60738eaa78 files: Rework send/recv-fds to be more generic
Remove getting opts from descriptors out from scm engine,
this stuff is pure criu thing, so make it collect the data.

The tricky change here is that parasite code needs memory
to keep fd_opts on. The memory is taken from parasite args
region, which is now bigger than it used to be. But that's
not a big deal, as previously this space was allocated on
the parasite stack (!, but with smaller chunks).

On the other hand, now we have one memcpy less, as opts are
put directly into the destination buffer.

travis-ci: success for files: Rework send/recv-fds to be more generic
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-12 16:22:19 +03:00
Cyrill Gorcunov
ed4a4b7507 scm: Unweave fds mess
Currently criu built with criu/pie-util-fd (which
is a symlink to criu/pie/util-fd) with same flags
as we use in general compel infection code. Moreover
the criu link with libcompel.a, so we get a problem
where send_fds/recv_fds are multiple defined. Lets
rather unweave this mess:

 - drop criu/pie-util-fd.c completely
 - move send_fd/recv_fd inliners into scm.h

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-12 16:22:19 +03:00
Cyrill Gorcunov
3c98261730 compel: plugins,fds -- Unify prototypes
- Declare send_fds, recv_fds in sch.h, these
   are prototypes used in both compel and criu
 - Drop old protos from plugin-fds.h uapi file
 - Drop old code from fds.c source

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-12 16:11:58 +03:00
Cyrill Gorcunov
a1f674e34b scm: common -- Hide struct fd_opts argument
When SCM_FDSET_HAS_OPTS is not set the scm-code.c
can't be built because it declares struct fd_opts
in parameters. Lets rather hide this type and
allow to build without SCM_FDSET_HAS_OPTS definition.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-12 16:07:50 +03:00
Cyrill Gorcunov
187377a526 scm: scm_fdset_init -- Drop unused @with_flags argument
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-12 16:07:41 +03:00
Pavel Emelyanov
165203b3c6 scm: Move scm_fdset structure into include/common
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-12 16:07:26 +03:00
Pavel Emelyanov
7279c0e7b4 scm: Compile out opts management
In pure-compel library messing with opts is not required,
only criu and criu's pie will need it, so make it possible
to compile out common/scm-code's opts management.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-12 16:07:15 +03:00
Pavel Emelyanov
bc102ea1bf scm: Define __memcpy
Depending on the code using it, memcpy will be different.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-12 16:07:06 +03:00
Pavel Emelyanov
554d0f0ab4 scm: Move fd-sending core code AS IS into include/common/
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-12 16:06:50 +03:00
Pavel Emelyanov
553c6ff8d8 criu: Version 2.9
This is quite a tiny bigfix mostly release.

One interesting thing, though, is that CRIU can now be built with
clang on all the supported architectures :)

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
v2.9
2016-12-12 11:42:12 +03:00
Adrian Reber
d08622811d crit: added crit manpage
Based on debian's manpage from Salvatore Bonaccorso:

e708a3a Sync manpage for crit to include short explanation for new subcommands
7dd571a Fix position for optional arguments in crit's manpage
017f8d9 Add minimal manpage for the crit

travis-ci: success for crit: added crit manpage
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-12 11:34:22 +03:00
Andrei Vagin
f47540234d shmem: skip zero pages
page_in_parent() returns true for all not dirty pages,
probably it should not be executed for zero pages.

------------------------ grep Error ------------------------
(00.115327) Error (criu/pagemap.c:191): Missing 8000 in parent pagemap, current iov: base=9000,len=32768
(00.115329) Error (criu/page-xfer.c:237): Hole 0x8000/4096 not found in parent
(00.160222) Error (criu/cr-dump.c:1636): Dumping FAILED.
------------------------ ERROR OVER ------------------------

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:48:17 +03:00
Andrei Vagin
7227e2ecc0 test: don't execute cgroup03 with other cgroup tests concurrently
https://github.com/xemul/criu/issues/253
travis-ci: success for test: don't execute cgroup03 with other cgroup tests concurrently
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:27 +03:00
Dmitry Safonov
6077c3d7f0 zdtm.py: print full pie errors in grep Error omitting line breaks
Before:
=[log]=> dump/zdtm/transition/shmem/142/1/dump.log
------------------------ grep Error ------------------------
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
------------------------ ERROR OVER ------------------------

After:
=[log]=> dump/zdtm/transition/shmem/62/1/dump.log
------------------------ grep Error ------------------------
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 1: e/asm/parasite.h:45): Failed to dump TLS descriptor #13: -4
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 1: e/asm/parasite.h:45): Failed to dump TLS descriptor #14: -4
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: e/asm/parasite.h:45): Failed to dump TLS descriptor #13: -4
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: e/asm/parasite.h:45): Failed to dump TLS descriptor #14: -4
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: e/asm/parasite.h:45): Failed to dump TLS descriptor #13: -4
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: e/asm/parasite.h:45): Failed to dump TLS descriptor #14: -4
------------------------ ERROR OVER ------------------------

Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:27 +03:00
Andrei Vagin
890457ef75 zdtm: add a test to check a mount tree with overmounts
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:27 +03:00
Andrei Vagin
96de90db31 mnt: try to split a mount tree to restore over-mounted mounts
If a mount overmounts something else, we can try to restore it
separetly and then move it to the right places after restoring
all mounts.

In this patch if we see that a mount is overmounts something,
we create a new directory in the root yard and restore this
mount and its sub-tree in this directory.

https://bugs.openvz.org/browse/OVZ-6778

v2: add more comments
    rename roots_mp into roots_yard_mp
v3: rename functions

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:27 +03:00
Andrei Vagin
4ac401fdb0 mnt: rename roots_mp into root_yard_mp and make it global
It is preparation to handle over-mounts.

v2: don't set the same name for global and local variables
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:27 +03:00
Andrei Vagin
432504d403 mnt: add a sub-id to print_ns_root
It will be used to handle overmounts

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:27 +03:00
Andrei Vagin
bad162f0ee mnt: clean up
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:27 +03:00
Yixun Lan
f6c7c0735e include sys/sysmacros.h for minor/major/makedev funcs
Since glibc is moving away from implicitly including sys/sysmacros.h
all the time via sys/types.h, include the header directly in more
places.  This seems to cover most makedev/major/minor usage.

Signed-off-by: Yixun Lan <dlan@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:27 +03:00
Cyrill Gorcunov
1c43dc2d86 restore: Report error number if PR_SET_MM failed
travis-ci: success for restore: Report error number if PR_SET_MM failed
Reported-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:27 +03:00
Adrian Reber
3e15360580 zdtm: set cpu.cfs_period_us to 100 during sched_policy00 test
To run the test zdtm/static/sched_policy00
/sys/fs/cgroup/cpu/user.slice/cpu.cfs_period_us needs to be non zero.
This changes it to 100 during the test and resets it to the original
value once the test finishes.

travis-ci: success for zdtm: set cpu.cfs_period_us to 100 during sched_policy00 test
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:27 +03:00
Andrei Vagin
b108c7526a mnt: restore shared mounts in a correct shared group
Currently when we have a shared group, we set a source mount for all
of them and then we need to update a source mount when we mount a first
mount from a shared group, because a shared id can be only inherited.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:26 +03:00
Andrei Vagin
e9ca7932ab mnt: add a function to check whether a mount overmounts something
This function is going to be used more than once.

v2: don't change logic in this patch
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:26 +03:00
Cyrill Gorcunov
4a6b286c31 test: rmdir_open -- Delete two levels of directories
One level always been handled properly but
two levels may cause problems.

travis-ci: success for Multiple nested deleted dentries fix
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:26 +03:00
Cyrill Gorcunov
994d598746 criu: files-reg -- Create a complete path to deleted dentry
In case if several levels of dentries are missed we can't
restore them otherwise.

travis-ci: success for Multiple nested deleted dentries fix
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 22:42:26 +03:00
Cyrill Gorcunov
994478b0fb util: Make mkdirpat more generic
- take @mode into account
 - return system error codes on error

travis-ci: success for Multiple nested deleted dentries fix
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 19:37:07 +03:00
Andrei Vagin
cf5c57bf7f shmem: don't write zero pages into an image
https://github.com/xemul/criu/issues/260
https://travis-ci.org/avagin/criu/builds/182462796
https://ci.openvz.org/job/CRIU/job/criu-patchwork/941//console
v2: don't call page_pipe_add_hole for zero pages
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-09 18:27:09 +03:00
Raghavendra Prabhu
0bfa6a6cc1 Update the xtables deps for netns-test.
In some distros (such as Arch), libxtables_standard is part of iptables
as `/usr/lib/iptables/libxt_standard.so`. With this change, the test passes,
otherwise netns-nf test fails.

Tested with make test.

Signed-off-by: Raghavendra D Prabhu <me@rdprabhu.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-05 23:35:16 +03:00
Kirill Tkhai
d49fac1ab6 criu: Fix open() retval analysing
Negative retval is error, while 0 is OK.

v2: More places

travis-ci: success for criu: Fix open() retval analysing
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-05 23:35:15 +03:00
Andrei Vagin
70cdf43a90 net: add criu iptables rules at the head of the chain
CRIU uses iptables rules to block tcp connections and
if rules are added at the tail of the chain, other rules
can accept packets which have to be blocked.

travis-ci: success for series starting with [01/21] build: install libnet-dev
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-05 23:35:15 +03:00
Mike Rapoport
3ead6f0c6e zdtm: allow --keep-going anytime when running multiple tests
Currently it's possible to continue testing despite failures only when
running zdtm.py with --all option. Let's make --keep-going option also
valid when more than one test is requested with --tests or --from.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-05 23:35:15 +03:00
Pavel Emelyanov
b415a3c11b files: Explicitly set linked remap type
This makes crit show the type, which is handy. Also this will let us
deprecate the old format where remap type was encoded into remap ID.

travis-ci: success for files: Explicitly set linked remap type
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-05 23:35:15 +03:00