Commit 4159cd5d authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

cr-restore: Report the mem size if mmap failed

Without patch

 | Error (cr-restore.c:414): Unable to reserve memory: Invalid argument

with applied

 | Error (cr-restore.c:414): Unable to reserve memory (0 bytes): Invalid argument

more convenient for debugging.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 8dd32ad0
...@@ -424,7 +424,7 @@ static int read_vmas(int pid) ...@@ -424,7 +424,7 @@ static int read_vmas(int pid)
/* Reserve a place for mapping private vma-s one by one */ /* Reserve a place for mapping private vma-s one by one */
addr = mmap(NULL, priv_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); addr = mmap(NULL, priv_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
if (addr == MAP_FAILED) { if (addr == MAP_FAILED) {
pr_perror("Unable to reserve memory"); pr_perror("Unable to reserve memory (%lu bytes)", priv_size);
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment