[CRIU] [PATCH] compel: Print why memfd()-ing task fails

Pavel Emelyanov xemul at virtuozzo.com
Mon Apr 3 11:08:40 PDT 2017


Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>

---
 compel/src/lib/infect.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/compel/src/lib/infect.c b/compel/src/lib/infect.c
index c0b05e3..7f6d2f3 100644
--- a/compel/src/lib/infect.c
+++ b/compel/src/lib/infect.c
@@ -747,8 +747,11 @@ static int parasite_memfd_exchange(struct parasite_ctl *ctl, unsigned long size)
 	fd = (int)(long)sret;
 	if (fd == -ENOSYS)
 		return 1;
-	if (fd < 0)
+	if (fd < 0) {
+		errno = -fd;
+		pr_perror("Can't create memfd in victim");
 		return fd;
+	}
 
 	ctl->map_length = round_up(size, page_size());
 	lfd = ctl->ictx.open_proc(ctl->rpid, O_RDWR, "fd/%d", fd);
-- 
2.5.5


More information about the CRIU mailing list