[CRIU] [PATCH] restore: Set up zombie name on restore

Cyrill Gorcunov gorcunov at openvz.org
Fri Jul 12 02:07:46 EDT 2013


| 5230 \_ /home/criu/criu restore --file-locks --tcp-established -x -D dump/zombie00/5211/1 -o restore.log -v4 -d
| 5211    \_ ./zombie00 --pidfile=zombie00.pid --outfile=zombie00.out

https://bugzilla.openvz.org/show_bug.cgi?id=2635

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-restore.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index 20e6f41..e9eac8d 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -722,10 +722,14 @@ static int restore_one_fake(void)
 	return 0;
 }
 
-static int restore_one_zombie(int pid, int exit_code)
+static int restore_one_zombie(int pid, CoreEntry *core)
 {
+	int exit_code = core->tc->exit_code;
+
 	pr_info("Restoring zombie with %d code\n", exit_code);
 
+	sys_prctl(PR_SET_NAME, (long)(void *)core->tc->comm, 0, 0, 0);
+
 	if (task_entries != NULL) {
 		restore_finish_stage(CR_STATE_RESTORE);
 		zombie_prepare_signals();
@@ -799,7 +803,7 @@ static int restore_one_task(int pid, CoreEntry *core)
 		ret = restore_one_alive_task(pid, core);
 		break;
 	case TASK_DEAD:
-		ret = restore_one_zombie(pid, core->tc->exit_code);
+		ret = restore_one_zombie(pid, core);
 		break;
 	default:
 		pr_err("Unknown state in code %d\n", (int)core->tc->task_state);
-- 
1.8.1.4



More information about the CRIU mailing list