[CRIU] [PATCH 5/4] unshare: Add RPC bits

Pavel Emelyanov xemul at virtuozzo.com
Wed May 4 09:04:39 PDT 2016


This completes the --unshare feature (except for userns).

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/cr-service.c | 5 ++++-
 images/rpc.proto  | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/criu/cr-service.c b/criu/cr-service.c
index 219a986..93d146f 100644
--- a/criu/cr-service.c
+++ b/criu/cr-service.c
@@ -471,6 +471,9 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
 			goto err;
 	}
 
+	if (req->has_unshare)
+		opts.unshare_flags = req->unshare;
+
 	if (req->n_irmap_scan_paths) {
 		for (i = 0; i < req->n_irmap_scan_paths; i++) {
 			if (irmap_scan_path_add(req->irmap_scan_paths[i]))
@@ -542,7 +545,7 @@ static int restore_using_req(int sk, CriuOpts *req)
 	success = true;
 exit:
 	if (send_criu_restore_resp(sk, success,
-				   root_item ? root_item->pid.real : -1) == -1) {
+				   root_item ? restored_root_pid(): -1) == -1) {
 		pr_perror("Can't send response");
 		success = false;
 	}
diff --git a/images/rpc.proto b/images/rpc.proto
index 9ece4da..0bd4ef7 100644
--- a/images/rpc.proto
+++ b/images/rpc.proto
@@ -97,6 +97,7 @@ message criu_opts {
 	repeated string			external	= 37;
 	optional uint32			empty_ns	= 38;
 	repeated join_namespace		join_ns		= 39;
+	optional uint32			unshare		= 40;
 }
 
 message criu_dump_resp {
-- 
2.5.0



More information about the CRIU mailing list