We will need to reuse this code in criu library, where libc calls
are present thus we will be compiling it in shared mode.
Because internal syscalls library won't be needed we wrap them
with __sys macro which would hide the details of invocation depending
on CR_NOGLIBC preprocessor variable passed from command line.
Original-patch-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
These contain linkage between number, data type and routines
for pb messages we write/read to/from image files. Most of them
have simple number-type-routines mapping, so introduce a generating
script for that.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Add target lib to Makefile for criu library.
Created directory lib and add there Makefile and criu.c - skelettons for criu library.
Signed-off-by: Ruslan Kupreev <kupruser@gmail.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>
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>
This patch adds LDFLAGS directive to build with -static.
You can build in static mode like below:
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi LDFLAGS=-static
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Acked-by: Alexander Kartashov <alekskartashov@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Note it can be overriden from command line.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Chanho Park <chanho61.park@samsung.com>
CC: Myungjoo Ham <myungjoo.ham@samsung.com>
Acked-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It's quite minimal at moment and provides only two helpers
- vdso_redirect_calls, to patch vdso area redirectling
calls to some new place.
- vdso_fill_symtable, to parse vma area as vdso library
and fill symbols table with offsets and names.
Because these routines will be needed in both regular criu
code and restorer code -- we compile it in pie format.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Will need to extend it to support vdso-pie code which
used in both -- pie code and plain executable code.
I know it's ugly and I must invent some more elegant
way, but need some solution at moment to be able to
compile existing code.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It's being reported that some systems (as Ubuntu 13.04) already
have struct tcp_repair_opt definition in their system headers.
| sk-tcp.c:25:8: error: redefinition of struct tcp_repair_opt
| sk-tcp.c:31:2: error: redeclaration of enumerator TCP_NO_QUEUE
So add a facility for compile time testing for reported entities
to be present on a system. For this we generate include/config.h
where all tested entries will lay and source code need to include
it only in places where really needed.
Reported-by: Vasily Averin <vvs@parallels.com>
Acked-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Note to package maintainers:
1 Yes we do support DESTDIR.
2 From packaging scripts, use something like this:
make install DESTDIR=$RPM_BUILD_ROOT PREFIX=/usr
(v2: add PREFIX, install to /usr/local not /usr by default)
(v3: fix criu man section -- it is 8 not 1)
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
When silent make rules are enabled, we use special format
to inform what is going on, like this
$(E) " ACTION " files
We maintain specific whitespace around ACTION so different ones
are aligned nicely. Fix two places that were not aligned to the rest.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
$(E) is used for 'silent make' to inform about what is going on
when we are not printing actual commands being executed, and do
nothing in case of 'verbose make (i.e. make V=1).
For 'make help' we want to output the text regardless of whether
'silent make' is enabled or not.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This is lots-of-bug-fixes release -- many new people started playing
with criu and reported a lot of issues with it.
Other than this, we have several new features. First of all it's C/R
of netlink sockets C/R (required for Fedora container dump) and pending
signals.
Next, we've changed the format of memory dumps. This allowed us to
implement so called page server, that allows to send memory dumps
directly on another box w/o intermediate dump file. Also this new
format made it possible to implement the (not yet final) --snapshot
option, that demonstrates the work of user memory changes tracker
in the kernel.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
"Tools" in the context of a binary name doesn't make any sense,
because every binary is a tool (lstool, dftool), plus it's one
tool.
So let's rename the beast to criu, which is short, pretty unique
and coincides with the name of the project.
Backward-compatible symlink is added for the sake of tests,
we can fix them later and remove the link.
Packagers beware: our binary is no longer crtools but criu.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
1 The comment before MAKEFLAGS assignment (see commit 25e8cb5) talks
about -r (and possibly -R) flags and has nothing to do with
--no-print-directory. Let's remove the last option to not confuse
a reader.
2 The --no-print-directory flag to build and build-crtools shorthands
is redundant, because scripts/Makefile.build has it already. Remove.
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We don't use TAGS, AWK or ECHO anywhere in the code (at least according
to git grep). Let's remove this.
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This reverts part of commit a519e0c which broke the man page build:
[kir@kirpad Documentation]$ make
" GEN " crtools.1
/bin/sh: GEN : command not found
make: *** [crtools.1] Error 127
So let's reintroduce Q and E in a separate Makefile.inc as it was
before.
Cc: Stanislav Kinsbursky <skinsbursky@openvz.org>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This reverts commit 396a08eb95.
As Andrew requested he needs the symbols to be generated for
all possible sources in the crtools code.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
clang-analyzer sets the environment variable CC
scan-build -plist-html --use-analyzer /usr/bin/clang make
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
In case if CFLAGS is overriden from command line we don't
see our headers anymore. So provide mandatory options in
ccflags-y variable to fix that.
https://bugzilla.openvz.org/show_bug.cgi?id=2521
Reported-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Tested-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This is the first release, that actually doesn't require a custom
kernel in order to make all the tool features to work. Just take
the v3.8 (with proper config) and that's it :)
Another coolness about this release is the ARM port. In this case,
however, one does require a custom kernel, since the kcmp system
call is not wired into the ARM table in the upstream kernel :(
What else? Quite a lot, actually:
* C/R ability of a LOT of new stuff
* Remote syscall execution
* Deprecation of --namespace option
* Build system rework
* Ability to collect gcov info
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Some of ours headers (such as syscall.h) are
clashes with system headers names. So we need
to be sure that the headers we include as
| #include "something.h"
being searched in known place. In particular on
some machines it it already produced problems.
This btw revealved a problem in cr-dump.c -- we've
had #include <parasite.h> there. Fix it.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Tested-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This allows to reuse the code and make rebuild to work correctly.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This is a bit tricky since the build infrastructure
we're switching to is targeted to per-directory targets
if simplified Makefiles are used.
So I did the following
- move rules to compile general sources to Makefile.crtools
- main Makefiles now simply calls for scritps/Makefile.build
help to generate built-in.o target
Also note that we clean up suffixes for implicit rules with
.SUFFIXES:
this is done on purpose to eliminate any possible side effect
in future -- all rules _must_ be described explicitly.
Because of implicit rules used in zdtm building procedure
I can't use of stict makefile mode and add
MAKEFLAGS := -r
to the top of the general Makefile. This should be done
one day latter (if ever).
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We're building project from toplevel directory so
no need for absolute paths.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Because we need util-net.c for both PIE code and
a regular code, just move it to pie/ directory
and build with -fpie option, this way we can reuse
compiled file in main program without additional
compilation pass.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
No need to walk up the directories if we need
to include protobuf file. This was always a bad
use of ability to walk the filesystem from other
headers.
Same time we don't need -I$(SRC_DIR)/protobuf/
in general makefile anymore.
[xemul: Small fixlet in head Makefile, since patch
it out-of-order]
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This allows us to have a unique place where version lives
and what is more important other subsystems (such as docs
generation) may reuse version definitions.
At moment EXTRA (which corresponds kernels -rc tag) and
NAME is not yet used, but I desided to put them in place
for future needs.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Otherwise I'm getting warnings (especially in zdtm)
when we are trying to remove non-generated .d files.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Actually the former code was being expanding
uname_M variable which is not set that early
(this was not a problem since we assign it a
line below, still it was a dead code which
should be fixed).
Also update
| ifeq ($(findstring arm,$(ARCH)),arm)
to simple
| ifeq ($(ARCH),arm)
Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Since we don't support x86-32 yet, issue an error early.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We collect all file locks to a golbal list, so we can use them easily
in dump_one_task. For optimizaton, we only collect file locks hold by
tasks in the pstree.
Thanks to the ptrace-seize machanism, we can aviod the blocked file lock
issue, makes the work simpler.
Right now, the check handles only one situation:
-- Dumping tasks with file locks hold without the -l option.
This covers for the most part. But we still need some more work to make
it perfect robust in the future.
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We will be handling both inotify and fanotify
objects here thus to make less confusion rename
the files to fsnotify.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>