Thank Vladimir Davydov <vdavidov@parallels.com> for help and config.
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Acked-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The current -march settings will cause an error if the user a
conflicting flags such as -mcpu=cortex-a15. Use USERCFLAGS instead
of CFLAGS so that a default is provided but can be overridden.
Change-Id: I8ffecd6bfd7ad5794486a5d14d27bce3170898d3
Acked-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Ideally, a user could set CFLAGS on the command line to contain
compilation options and include and library paths (or maybe set
those last two with CPPFLAGS and LDFLAGS). Unfortunately, setting
CFLAGS on the command line currently short-circuits essential
logic in the makefile and breaks the build. After a first failed
attempt it appears that a monolithic overhaul or "flag day" to
fix this is a substantial undertaking, so for now just provide a
workaround in the form of a USERCFLAGS variable.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Perhaps left over from when a single types.h was being used for
multiple architectures, remove the ARM definition of
AT_VECTOR_SIZE from the x86 types.h header. Also remove the
CONFIG_ARM definition since it unused.
Acked-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The current mechanism for determining ARM architecture version
breaks down when cross-compiling. Default to ARMv7 if the user
specifies ARCH=arm. Users wishing to cross-compile for ARMv6
platforms such as the Raspberry Pi should use ARCH=armv6 as
previously required.
Acked-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
ARCH is a user-facing variable and setting it on the command line
clobbers any manipulation attempted in the makefile. Following
the example of the Linux kernel makefiles, use a SRCARCH variable
instead for the internal, potentially fixed-up, architecture name.
This fixes the following error.
make ARCH=x86_64
Makefile:69: *** "The architecture x86_64 isn't supported". Stop.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The top-level makefile defines an ARCH_DIR variable. Always use
it rather than referencing ARCH directly, since ARCH may be set
by the user on the command line and that raw input may not be
what needs to be used internally.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The makefile includes need to be moved for everything to be
defined properly when the configure tests run.
The Ubuntu 12.04 x86_64 GCC and Linaro's 13.08 and newer AArch64
GCC's have the if_packet.h kernel header, but as of 13.12,
the Linaro AArch32 GCC does not.
Change-Id: I363c43fdb81b028f99aac77e15bff9462c87af4b
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The links to the versioned libcriu.so.* included $(DESTDIR) and
$(LIBDIR) which will generate wrong links if building criu packages.
Now the links points to the correct file without any path.
For some reason criu.8 was installed with executable permission. Use
'install' with '-m 644' to make sure this does not happen.
Signed-off-by: Adrian Reber <adrian@lisas.de>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Using a soname makes it easy for applications to
detect if the ABI of libcriu.so has changed.
It still creates libcriu.so as before in lib. During
'make install' additional links are created:
libcriu.so -> libcriu.so.1.0
libcriu.so.1 -> libcriu.so.1.0
Signed-off-by: Adrian Reber <adrian@lisas.de>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
To link Open MPI against CRIU I need the header files installed.
Attached is a patch which adds the necessary Makefile rules to
install libcriu.so and the header file to compile against CRIU.
Signed-off-by: Adrian Reber <adrian@lisas.de>
Acked-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The bugfix period after 1.1-rc1 seems to be over.
With this version we pin down the API to plugins and libcriu.so.
Next steps will be tied with live-migration usecase for CRIU :)
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The feedback we got helped us to improve several issues all over
the criu code. And we have some more stuff to get fixed before we
can make a good release.
That said, let's go ahead with the -rc2.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Two major changes so far -- libcriu.so (RPC wrapper) and plugins.
Both define some API and we want to check this API is good enough.
Thus we tag the -rc1 to let people try it. If things go smooth, we
will just go agead and tar the 1.1.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Libraries (plugins) is going to be used for dumping and restoring
external dependencies (e.g. dbus, systemd journal sockets, charecter
devices, etc)
A plugin can have the cr_plugin_init() and cr_plugin_fini functions for
initialization and deinialization.
criu-plugin.h contains all things, which can be used in plugins.
v2: rename lib to plugin
v3: add a default value for a plugin path.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This test is similiar to test/rpc, and can also be used as an
example of using libcriu.
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Makes the criu RPC socket socket-activated with
systemd [1], meaning that systemd will create and listen to
the UNIX socket /var/run/criu-srvice.socket
on behalf of criu until a connection comes in, when it will
then pass control of the socket, along with the first connection
over to a newly spawned criu daemon.
This is similar to inetd, but criu stays around after getting
started, listening itsself on the socket.
[1] http://0pointer.de/blog/projects/socket-activation.html
v2: stripped down sd-daemon.[ch]
moved units to scripts/sd
v3: stripped down further by removing unneeded includes
Signed-off-by: Shawn Landden <shawn@churchofgit.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The next version is ready. It looks like it's time to make it
be the first major release, so here it is -- the v1.0. It's as
functional as v0.8 but with a lot of bug fixes and improvements.
And it's still :) compatible wrt images and cli options with
older criu-s.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
As planned, this was bugfix-mainly release. However, some new
features were added. Looking forward the v1.0 release :)
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
* Quite a lot of bugfixes and improvements in documentation, thanks to
feedback from users.
* New notable features include TUN devices, shared and master/slave
mounts and alternative signal stack (sigaltstack) support.
* Memory tracking is now upstream.
* This is the last release, that is tied to kernel release. The next
one will happen as soon as we decide it's worth doing so, not after
the linux-3.12.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
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>