2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00

3753 Commits

Author SHA1 Message Date
Ruslan Kuprieiev
07e153fc4c service: set success to true before exit
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-05 12:05:46 +04:00
Pavel Emelyanov
3708ecb499 mount: Introduce generic FSs parsing callback
And make use of it in for btrfs.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
2013-12-04 20:03:17 +04:00
Pavel Emelyanov
b6e2dfd2de mount: Prepare fstypes to contain more unsupported FSs
We will need to parse btrfs stuff, but this one is not
in the supported list yet (as it's bound to hardware).

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
2013-12-04 20:03:15 +04:00
Cyrill Gorcunov
a5785c94bc files-reg: Don't fail matching if ghost file is on BTRFS subvolume
In case if ghost file is on BTRFS subvolume we should not fail
but test if there is a match.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-04 19:23:34 +04:00
Cyrill Gorcunov
9e6bd8c512 sk-unix: Don't fail if socket path lays on btrfs volume
Because socket migh lay on btrfs volume (thus the device
number reported by diag module won't be the same as obtained
from stat(2)) we need to do an additional test and try
to resolve device number with help of btrfs engine.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-04 19:23:33 +04:00
Cyrill Gorcunov
e54ad19a06 mount: Add phys_stat_dev_match helper
This helper serves to hide fs specifics (in particular
btrfs) thus the caller won't need the details.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-04 19:23:32 +04:00
Cyrill Gorcunov
c9069ba09f proc_parse: Call for btrfs_parse_mountinfo on every mount
This helper will cause BTRFS engine to collect all subvolumes.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-04 19:23:31 +04:00
Cyrill Gorcunov
d4eaf8d612 btrfs: Introduce BTRFS engine
It is been found that BTRFS uses per subvolume device
numbering scheme  which causes some of our tests to fail
if they are laying on this filesystem.

Here we introduce minimal engine which parses subvolumes
present on mount point.

The interface is two functions

 - btrfs_parse_mountinfo: this one parses subvolume and caches the results
 - is_btrfs_subvol: test if device id is laying on subvolume

In the code we assume that cpu we're running on
is little endian, thus if one day we run on big
ending machine the code must be updated accordingly.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-04 19:23:28 +04:00
Cyrill Gorcunov
232e3a28a7 proc_parse: Introduce @private member into mount_info structure
It will hold auxiliary data associated with mount point. We
will use it for btrfs handling but in future it can be extended.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-04 18:18:22 +04:00
Cyrill Gorcunov
eeb21b8a34 proc_parse: Remember a type of FS provided by a kernel
We will need it for btrfs handling. Also print out the
FS type for easier debug

 | (00.003545)     type unsupported (cgroup) source cgroup 1c / @ /sys/fs/cgroup/blkio flags 30000e options blkio,
 | (00.003558)     type unsupported (cgroup) source cgroup 1d / @ /sys/fs/cgroup/perf_event flags 30000e options perf_event,
 | (00.003571)     type unsupported (cgroup) source cgroup 1e / @ /sys/fs/cgroup/hugetlb flags 30000e options hugetlb,
 | (00.003584)     type unsupported (ext4) source /dev/sda2 800002 / @ / flags 300000 options data=ordered,
 | (00.003670)     type tmpfs (tmpfs) source tmpfs 20 / @ /tmp flags 100000 options
 | (00.003696)     type unsupported (mqueue) source mqueue d / @ /dev/mqueue flags 300000 options

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-04 18:18:21 +04:00
Cyrill Gorcunov
56f4679dfc fsnotify: Fix typo in get_mark_path debug output
@path is always nil here, we actually need @remap->path

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-04 17:36:04 +04:00
Cyrill Gorcunov
a1fd4119bc mount: Print device obtained from stat() call
For debug purpose.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-03 22:50:40 +04:00
Cyrill Gorcunov
58c4631ae7 mount: Drop useless NULL assignment
We allocate mount_info with xzalloc, no need for
additional NULL assignment.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-03 22:50:00 +04:00
Cyrill Gorcunov
38c34aae5e proc_parse: Don't setup ret = 0 early
If we fail in xmalloc the function occasionally return
0 meaning that everything is fine. Don't do that, wait
until routine complete.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-03 22:49:30 +04:00
Pavel Emelyanov
20e8d193e5 tty: Print very descriptive message about shell job dump
First thing people typically do with criu is run something
in shell and try to dump it. This is typicall pitfall, as
in that case we face external sid and tty problem. Print a
message on stdout about this and advice wiki page to read.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-03 09:59:17 +04:00
Ruslan Kuprieiev
2e8ff1a22a v2 service: don't send dump response in case of self-dump without leave_running
Currently we have a bug: if no leave_running is set in request, service won't send dump response. We must not send response only if it was a self-dump request and no leave_running option was set.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-02 19:50:44 +04:00
Tikhomirov Pavel
7be5a1b95d v2 page-read: Check parent pagemap read return value
Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-02 15:28:59 +04:00
Cyrill Gorcunov
654131626e proc_parse: Delay freeing of kernel fs type
We will need it for additional handling once parsing
of mount entry is complete (in particular btrfs requires
additional processing to figure out subvolumes names).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-29 15:36:12 +04:00
Cyrill Gorcunov
b4266c7e67 string: Add strlcat helper
We will need it for btrfs subvolumes handling.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-29 15:36:07 +04:00
Cyrill Gorcunov
f4e40ef7e2 mount: Use is_root_mount helper instead of strcmp
It's designed specificly for that.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-28 15:46:00 +04:00
Cyrill Gorcunov
d7141750d2 sk-unix: Use pr_warn instead of pr_perror if socket path can't be stat'ed
The error message is rather confusing people. In worst case (if
it happened that we need this uncollected socket), criu will
print out real error message later.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-28 15:38:52 +04:00
Cyrill Gorcunov
75ebb6d02c sk-unix: Print the name of sockets being dropped
Useful for bug hunting.

 | (00.005209) unix: Dropping path /mnt/disk1/new_subvol/criu/test/zdtm/live/static/sockets00.test
 | for unlinked bound sk 0x26.0x1d4e real 0x23.0x1d4e

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-28 15:36:33 +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>
v1.0
2013-11-25 20:05:10 +04:00
Andrey Vagin
57d25e7cea mm: fix expression to determine which vma-s can be shared
Currently only addresses are compared. It's obviously not enough.

* First of all the parent vma must be private.
* Both vma-s must have the identical set of MAP_GROWSDOWN and MAP_FILES
  flags.
* Both vma-s must be linked to the same file.

https://bugzilla.openvz.org/show_bug.cgi?id=2824
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-22 18:19:23 +04:00
Andrey Vagin
7659c995f5 vm: don't overwrite vma->shmid for private mappings
shmid contains a file id for file mappings. It's required to determine,
which VMA-s are cowed. The parent maps a VMA and saves premmaped
address. Then  child trys to determing, which VMA-s must be inhereted
from parent, for that it compares addresses, flags and file id.

We don't want to transfer vma_area-s in restorer, so when a VMA entry is
copied in restorer memory, the premmaped address is save in shmid.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-22 18:19:08 +04:00
Ruslan Kuprieiev
b49d096016 service: set CHECK type on check response
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-22 09:29:12 +04:00
Pavel Emelyanov
42bd5163df files: Print more info about unsupported fd to dump
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-21 15:28:37 +04:00
Pavel Emelyanov
2677006cf5 restorer: Check error from exe link restore
Kenrel API is stable enough not to ignore it.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-21 15:28:14 +04:00
Kir Kolyshkin
e49faff1ff fopen_proc(), opendir_proc(): don't print two errors
Both fopen_proc() and opendir_proc() are calling open_proc().
If open_proc() fails, it prints an error message. Before this
patch, a second error message was printed due to missing brackets.
This second message is a bit more specific (it tells the exact
file/dir we failed to open) but it is redundant, because more
generic error was already printed by open_proc(). It is also
can be misleading because for the second message we reuse
the same errno while we should not.

So, let's remove this second error message print by using brackets.

Alternatively, we could leave this as is (just fixing indentation)
and let two errors be printed -- there is nothing wrong with that,
but I think in this case less messages is better.

This is a fix to commit 5661d80.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-21 13:40:35 +04:00
Pavel Emelyanov
2ba384e852 rst: Add comment about old memory unmap
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-20 14:41:34 +04:00
Pavel Emelyanov
c3b9448cf7 pidfile: Don't push opts.pidfile as write_pidfile arg
opts are criu-wide available.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-20 14:26:41 +04:00
Ruslan Kuprieiev
0b5b2f9906 service: Add support for check request
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-20 14:16:44 +04:00
Ruslan Kuprieiev
9ccbf1bcc8 v2 crtools: init log after changing directory to work_dir
After set of patches which add --work-dir option we have an issue: logs are created relatively
to current dir and not relatively to images dir(which is work dir, when --work-dir is not given).
To solve this lets init log after chdir(work_dir)

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-19 22:50:20 +04:00
Ruslan Kuprieiev
486cad37cc image: Open parent image dir with -at calls
After fixes with -W option we've changed the cwd at the
time parent images are opened. Use the -at syscall to
proerly access ones.

[ Cleanup and comment from xemul@ ]

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-18 13:22:10 +04:00
Ruslan Kuprieiev
80559828d6 v2 stats: write stats at work directory
Stats must be in work dir, as logfiles and pidfiles.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-16 00:05:53 +04:00
Pavel Emelyanov
5d4824fff0 crtools: Fix help text according to new -W option
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 21:51:19 +04:00
Ruslan Kuprieiev
b1a197f0b8 page-server/service: do not chdir / when going daemon
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 21:38:44 +04:00
Ruslan Kuprieiev
482b30666f crtools: chdir to work directory
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 21:38:42 +04:00
Ruslan Kuprieiev
dc80d6f125 log: get rid of LOG_DIR_FD_OFF and opening cwd in log_init()
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 21:38:41 +04:00
Ruslan Kuprieiev
127637bc49 image: add dir parameter to open_image_dir()
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 21:38:40 +04:00
Ruslan Kuprieiev
555c8acd4d crtools: add --work-dir(-W) option
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 21:38:39 +04:00
Cyrill Gorcunov
291aa3f6d6 headers: Add extern specificator to functions
We really have a mess of extern/non-extern declaration
of functions in our headers. Always use extern for
unification purpose.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 17:00:58 +04:00
Cyrill Gorcunov
39752a1465 headers: ptrace.h -- Reflect name change in ifdef/endif
The file name was changed but ifdef/endif hadn't been
updated. Fix it.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 17:00:28 +04:00
Cyrill Gorcunov
3456e56134 headers: Add \Newline-s for readability sake
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 17:00:14 +04:00
Cyrill Gorcunov
3f03d139d3 headers: Add missing __CR_ at last endif
For big #ifdef/#endif chunks we do a comment /* */
at #endif. Add missing ones.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 16:59:57 +04:00
Cyrill Gorcunov
ada7322a9c headers: Drop _LINUX_CAPABILITY
Use one provided in linux/capability.h

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 16:59:40 +04:00
Andrey Vagin
ec91abf0a8 zdtm/selfexe00: append a null byte to paths
readlink() does not append a null byte to buf.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 16:32:00 +04:00
Pavel Emelyanov
9a8475ae03 image: Stopped tasks are supported, fix comments
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 00:27:45 +04:00
Pavel Emelyanov
e42a486f39 files: Extend comment about "overlinked" files dump and restore
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 00:26:54 +04:00
Cyrill Gorcunov
ce3b4aaafa headers: Move MADV definitions to own mman.h
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 22:48:30 +04:00