[CRIU] [PATCH] cr-service: set cr_errno if cpuinfo dump is not supported

Adrian Reber adrian at lisas.de
Tue Nov 3 07:21:00 PST 2015


From: Adrian Reber <areber at redhat.com>

Right now only x86 supports dumping and checking the cpuinfo. All other
architectures are returning -ENOTSUP and thus p.haul fails if started
without '--force'. This adds -ENOTSUP to the RPC field cr_errno in the
case cpuinfo dumping and checking failed with this return code.

Signed-off-by: Adrian Reber <areber at redhat.com>
---
 cr-service.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/cr-service.c b/cr-service.c
index 7fe0e48..599aab7 100644
--- a/cr-service.c
+++ b/cr-service.c
@@ -837,10 +837,20 @@ cout:
 	}
 
 	wait(&status);
-	if (!WIFEXITED(status) || WEXITSTATUS(status))
+	if (!WIFEXITED(status))
 		goto out;
+	switch (WEXITSTATUS(status)) {
+	case (-ENOTSUP & 0xff):
+		resp.has_cr_errno = 1;
+		resp.cr_errno = WEXITSTATUS(status);
+		break;
+	case 0:
+		success = true;
+		break;
+	default:
+		break;
+	}
 
-	success = true;
 out:
 	resp.type = msg->type;
 	resp.success = success;
-- 
1.8.3.1



More information about the CRIU mailing list