mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 13:28:27 +00:00
mem: Treat /proc/pid/pagemap2 file as optional
It will appear not earlier than in 3.10. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
d4e1df3a03
commit
a3872dbead
@ -4,6 +4,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "kerndat.h"
|
||||
@ -71,6 +72,12 @@ int kerndat_get_dirty_track(void)
|
||||
|
||||
pm2 = open("/proc/self/pagemap2", O_RDONLY);
|
||||
if (pm2 < 0) {
|
||||
munmap(map, PAGE_SIZE);
|
||||
if (errno == ENOENT) {
|
||||
pr_info("No pagemap2 file\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
pr_perror("Can't open pagemap2 file");
|
||||
return ret;
|
||||
}
|
||||
|
10
mem.c
10
mem.c
@ -315,8 +315,14 @@ static int __parasite_dump_pages_seized(struct parasite_ctl *ctl,
|
||||
goto out_snap;
|
||||
|
||||
ret = pagemap = open_proc(ctl->pid.real, "pagemap2");
|
||||
if (ret < 0)
|
||||
goto out_free;
|
||||
if (ret < 0) {
|
||||
if (errno != ENOENT)
|
||||
goto out_free;
|
||||
|
||||
ret = pagemap = open_proc(ctl->pid.real, "pagemap");
|
||||
if (ret < 0)
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
ret = -1;
|
||||
pp = create_page_pipe(vma_area_list->priv_size / 2, args->iovs);
|
||||
|
Loading…
x
Reference in New Issue
Block a user