2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 22:05:36 +00:00

dump: support SYSV IPC vma

This patch introduces the following changes:

1) introduces new flag VMA_AREA_SYSVIPC to mark corresponding vma entries.
2) enhance task /proc/<pid>/maps parsing to obtain first 5 letters of mapped
   file. If device major file belong to ins equal to 0 (tmpfs) and it's name
   starts with "/SYSV", then this mapping is considered as SYSV IPC and
   corresponding vma entry status is updated with VMA_AREA_SYSVIPC flag.
3) omit dumping of mapping pages for SYSV IPC vmas.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
Kinsbursky Stanislav
2012-02-14 20:19:49 +03:00
committed by Cyrill Gorcunov
parent 40fc4d2122
commit b3cfe73556
3 changed files with 17 additions and 3 deletions

View File

@@ -45,11 +45,14 @@ int parse_maps(pid_t pid, int pid_dir, struct list_head *vma_area_list, bool use
while (fgets(big_buffer, sizeof(big_buffer), maps)) {
struct stat st_buf;
int num;
char file_path[6];
num = sscanf(big_buffer, "%lx-%lx %c%c%c%c %lx %02x:%02x %lu",
memset(file_path, 0, 6);
num = sscanf(big_buffer, "%lx-%lx %c%c%c%c %lx %02x:%02x %lu %5s",
&start, &end, &r, &w, &x, &s, &pgoff, &dev_maj,
&dev_min, &ino);
if (num != 10) {
&dev_min, &ino, file_path);
if (num < 10) {
pr_err("Can't parse: %s", big_buffer);
goto err;
}
@@ -133,6 +136,11 @@ int parse_maps(pid_t pid, int pid_dir, struct list_head *vma_area_list, bool use
vma_area->vma.flags |= MAP_ANONYMOUS;
vma_area->vma.status |= VMA_ANON_SHARED;
vma_area->shmid = st_buf.st_ino;
if (!strcmp(file_path, "/SYSV")) {
pr_perror("path: %s\n", file_path);
vma_area->vma.status |= VMA_AREA_SYSVIPC;
}
} else {
if (vma_area->vma.flags & MAP_PRIVATE)
vma_area->vma.status |= VMA_FILE_PRIVATE;