Commit graph

192 commits

Author SHA1 Message Date
Ruslan Kuprieiev
bf288e27a2 install: install criu-service logrotate config
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>
2014-02-18 12:39:50 +04:00
Christopher Covington
4be26b4383 Make -march settings part of USERCFLAGS
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>
2014-02-10 14:36:26 +04:00
Christopher Covington
9ca415c3b6 Allow for user CFLAGS
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>
2014-02-10 14:35:52 +04:00
Christopher Covington
f69fe9aa13 Remove ARM AT_VECTOR_SIZE from x86 header
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>
2014-02-10 14:35:32 +04:00
Christopher Covington
851e89ce3a Default to ARMv7
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>
2014-02-10 14:35:08 +04:00
Christopher Covington
d6005ed12e Use SRCARCH internally
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>
2014-02-10 14:33:47 +04:00
Christopher Covington
89bb170a26 Always use ARCH_DIR
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>
2014-02-10 14:33:11 +04:00
Christopher Covington
b0549064c1 Make tpacket_req3 definition conditional
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>
2014-02-10 14:31:02 +04:00
Adrian Reber
35763e0b50 Makefile: fix libcriu.so links and man page installation
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>
2014-02-10 14:27:43 +04:00
Adrian Reber
b0e6ebc1c7 Makefile: add soname to libcriu.so
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>
2014-02-07 15:35:20 +04:00
Adrian Reber
48b22f0d95 Makefile: Also install libcriu.so and headers
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>
2014-02-05 16:20:19 +04:00
Pavel Emelyanov
004f1f5bbe criu: Version 1.1 release
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>
2014-01-28 13:04:03 +04:00
Pavel Emelyanov
9f2f4afbcc criu: Version 1.1-rc2
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>
2014-01-20 15:28:23 +04:00
Pavel Emelyanov
b876dfa3a9 criu: Version 1.1-rc1
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>
2013-12-31 14:08:50 +04:00
Andrey Vagin
d7cf271ed4 crtools: preload libraries (v2)
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>
2013-12-19 21:48:33 +04:00
Ruslan Kuprieiev
ca1f60d267 test: libcriu
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>
2013-12-18 14:26:12 +04:00
Shawn Landden
2e15e4da92 systemd socket activation support
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>
2013-12-12 09:58:50 +04:00
Pavel Emelyanov
f2bb77c017 criu: Version 1.0 release
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>
2013-11-25 20:05:10 +04:00
Alexander Kartashov
9af8d94901 cr: identify LDARCH and ARCH by default
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-01 14:27:07 +04:00
Pavel Emelyanov
272c94e35b criu: Version 0.8 release
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>
2013-10-18 20:45:08 +04:00
Andrey Vagin
9a2219af0c make: clean up test data, if a test completed successfully
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 14:56:59 +04:00
Pavel Emelyanov
74070c84dd criu: Version 0.7 release
* 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>
2013-09-03 15:32:52 +04:00
Cyrill Gorcunov
dfdac2cf3a make: Use generic build engine for libcriu.so
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-29 14:48:13 +04:00
Cyrill Gorcunov
c75c92db1d pie: Move send_fds/recv_fds helpers into separate pie/util-fd.c
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>
2013-08-29 14:48:10 +04:00
Pavel Emelyanov
84737e2796 build: Generate most of the pb-desc automatically
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>
2013-08-23 21:47:31 +04:00
Pavel Emelyanov
72ec39f10c util: Rename pie's util-net.c into util.c
Will put more things there.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-29 12:43:30 +04:00
Ruslan Kupreev Руслан
27f9b0335d v2 criu: Initial skeleton for criu library
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>
2013-07-18 21:47:11 +04:00
Alexander Kartashov
3a94986310 cr: determine the version of the ARM architecture of the target machine
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>
2013-07-10 15:56:57 +04:00
Pavel Emelyanov
1845284009 criu: Version 0.6 release
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>
2013-07-01 21:31:05 +04:00
Chanho Park
d3b122fbc0 Makefile: Add LDFLAGS directive
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>
2013-06-11 11:02:42 +04:00
Cyrill Gorcunov
d73c4c1ff4 make: Allow to use CROSS_COMPILE prefix
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>
2013-05-31 13:45:30 +04:00
Cyrill Gorcunov
61cc86ddd2 vdso: Introduce vdso pie-engine
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>
2013-05-24 13:27:13 +04:00
Cyrill Gorcunov
9208108c9f make: Define program object deps as separate variable
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>
2013-05-24 13:24:29 +04:00
Cyrill Gorcunov
66cc9b6657 make: Introduce compile time include/config.h generation
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>
2013-05-20 16:02:14 +04:00
Kir Kolyshkin
befe5ad155 make help: document dist target
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-03 01:56:31 +04:00
Kir Kolyshkin
e516aa0122 Makefiles: add install target
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>
2013-05-03 01:56:30 +04:00
Kir Kolyshkin
525da872b2 Makefile: mark gcov target as phony
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:35:36 +04:00
Kir Kolyshkin
fda4562049 Makefile: pass few targets at once
Be green -- save bytes!

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:35:28 +04:00
Kir Kolyshkin
15c3e884fa Makefile: fix whitespace in first $(E) argument
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>
2013-05-02 22:35:01 +04:00
Kir Kolyshkin
c7f22b8daf make help: rename crtools to criu
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:34:39 +04:00
Kir Kolyshkin
fa291ae858 Makefile: don't use $(E) for help
$(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>
2013-05-02 22:34:33 +04:00
Kir Kolyshkin
b94047e42f Makefile: add tar and dist targets
...using "git archive" command line from Pavel.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:32:21 +04:00
Pavel Emelyanov
9fec380c71 criu: Version 0.5 release
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>
2013-04-30 20:50:03 +04:00
Kir Kolyshkin
354f82c3f5 crtools: rename binary to criu
"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>
2013-04-30 20:17:55 +04:00
Kir Kolyshkin
2cd78c5de7 Makefile: remove --no-print-directory
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>
2013-04-29 16:06:40 +04:00
Kir Kolyshkin
4e1be049f5 Makefile: remove unused vars
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>
2013-04-29 16:06:39 +04:00
Kir Kolyshkin
97802b0d55 Makefile.inc: restore
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>
2013-04-29 16:06:37 +04:00
Cyrill Gorcunov
6bdc149642 Revert "make: Don't generate tags/cscope for tools/ and test/"
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>
2013-04-19 16:01:16 +04:00
Cyrill Gorcunov
396a08eb95 make: Don't generate tags/cscope for tools/ and test/
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-04 14:08:32 +04:00
Andrey Vagin
f238d56661 make: allow to change a compiler
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>
2013-04-04 14:00:19 +04:00