Commit 6a607827 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

restorer: Change endless loop to sys_exit in case of error

If an error happens during late restore stage, we better
exit with error than dive into endless loop.

The loop was useful at early prototype times,
but not now when we use zdtm test suite.

For example, force injected error now reports

 | Restoring EXE (/home/crtools/test/zdtm/live/static/selfexe00)
 | 764
 | 11308
 | Error (cr-restore.c:1280): 11308 exited, status=255
 | Error (cr-restore.c:1412): Someone can't be restored

which is a way better than silent loop.
Reported-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 3665a897
......@@ -228,9 +228,8 @@ long restore_thread(struct thread_restore_args *args)
core_restore_end:
write_num_n(__LINE__);
write_num_n(sys_getpid());
for (;;)
local_sleep(5);
sys_exit(0);
sys_exit(-1);
return -1;
}
static long restore_self_exe_late(struct task_restore_core_args *args)
......@@ -764,7 +763,6 @@ long restore_task(struct task_restore_core_args *args)
core_restore_end:
write_num_n(__LINE__);
write_num_n(sys_getpid());
for (;;)
local_sleep(5);
sys_exit(0);
sys_exit(-1);
return -1;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment