mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
kerndat: Produce sane error messgaes
I've just occasionally tried to run criu on old openvz kernel and the error message was looking somehow strange to me | Error (kerndat.c:39): Can't stat piggie: No such file or directory Lets produce some more detailed error text. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
53aae95796
commit
9556ffb112
@@ -28,7 +28,7 @@ static int kerndat_get_shmemdev(void)
|
||||
map = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED | MAP_ANONYMOUS, 0, 0);
|
||||
if (map == MAP_FAILED) {
|
||||
pr_perror("Can't mmap piggie");
|
||||
pr_perror("Can't mmap memory for shmemdev test");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -36,14 +36,14 @@ static int kerndat_get_shmemdev(void)
|
||||
(unsigned long)map, (unsigned long)map + PAGE_SIZE);
|
||||
if (stat(maps, &buf) < 0) {
|
||||
munmap(map, PAGE_SIZE);
|
||||
pr_perror("Can't stat piggie");
|
||||
pr_perror("Can't stat self map_files");
|
||||
return -1;
|
||||
}
|
||||
|
||||
munmap(map, PAGE_SIZE);
|
||||
|
||||
kerndat_shmem_dev = buf.st_dev;
|
||||
pr_info("Found anon-shmem piggie at %"PRIx64"\n", kerndat_shmem_dev);
|
||||
pr_info("Found anon-shmem device at %"PRIx64"\n", kerndat_shmem_dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ int kerndat_get_dirty_track(void)
|
||||
map = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE,
|
||||
MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
|
||||
if (map == MAP_FAILED) {
|
||||
pr_perror("Can't mmap piggie2");
|
||||
pr_perror("Can't mmap memory for pagemap test");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user