[CRIU] [PATCH] cr-restore: Report the mem size if mmap failed

Cyrill Gorcunov gorcunov at openvz.org
Thu Mar 14 11:24:03 EDT 2013


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: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-restore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cr-restore.c b/cr-restore.c
index 1b7ee8f..8a312b3 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -411,7 +411,7 @@ static int read_vmas(int pid)
 	/* Reserve a place for mapping private vma-s one by one */
 	addr = mmap(NULL, priv_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
 	if (addr == MAP_FAILED) {
-		pr_perror("Unable to reserve memory");
+		pr_perror("Unable to reserve memory (%lu bytes)", priv_size);
 		return -1;
 	}
 
-- 
1.8.1.4



More information about the CRIU mailing list