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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>