Commit graph

9 commits

Author SHA1 Message Date
Cyrill Gorcunov
594fb52753 build: Move @protobuf dir into @images
But keep @protobuf as a symlink: we have
this path encoded in sources. Gonna be
removed with time.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-15 15:32:27 +03:00
Adrian Reber
ff3fb16f14 crit: Pretty print vma flags and status
To better understand the content of mm-<ID>.img and pagemap-<ID>.img
additional constant names have been added to better resolve the hex
value to symbolical names.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-08 16:34:48 +03:00
Pavel Emelyanov
e9bb16265b img: Add text for known flags
Currently there are open flags on reg-files and vma
flags and prot.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-21 11:52:14 +03:00
Andrey Vagin
692ed6e1f4 protobuf: add [(criu).hex = true] for masks, flags, etc (v2)
v2: fix mm.proto too
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-01-27 16:06:59 +03:00
Jamie Liu
efe594f8f4 criu: fix filemap open permissions
An mmaped file is opened O_RDONLY or O_RDWR depending on the permissions
on the first vma dump_task_mm() encounters mapping that file. This
causes two problems:

1. If a file has multiple MAP_SHARED mappings, some of which are
   read-only and some of which are read-write, and the first encountered
   mapping happens to be read-only, the file will be opened O_RDONLY
   during restore, and mmap(PROT_WRITE) will fail with EACCES, causing
   the restore to fail.

2. If a file is opened read-write and mapped read-only, it will be
   opened O_RDONLY during restore, so restore will succeed, but
   mprotect(PROT_WRITE) on the read-only mapping after restore will
   fail.

To fix both of these, record open flags per-vma based on the presence of
VM_MAYWRITE in smaps.

Signed-off-by: Jamie Liu <jamieliu@google.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-04-04 20:35:48 +04:00
Cyrill Gorcunov
44624667a7 proto: Align members and numbers
We're aligning members and number in protobuf
files from the very beginning for readability
sake. So fix up newer ones which were not.

Also use /* */ comments, not //.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-07 15:40:52 +04:00
Cyrill Gorcunov
cc6af3898e memory: Add pasing of VmFlags
The kernel now supports providing VMA flags via smaps
interface so add pasting of them.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-26 00:16:05 +04:00
Pavel Emelyanov
7f1c9af0f8 vma: State that vma->fd is -1 constant in the image
This field was lost while switching to protobuf -- the vma images
were used by parasite as plain array and it was easier to reseve
this space in the image. Now it's too late to change this, so make
it be -1 always.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-10 10:17:50 +04:00
Cyrill Gorcunov
4806e1395f protobuf: Convert vma_entry to PB format v3
v2:
 - Use regular uint types in message proto
 - Use PB engine for "show"
v3:
 - drop usage of temp. variable in prepare_shmem_pid

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 12:43:36 +04:00