[CRIU] [PATCH] restore: Set up zombie name on restore
Andrew Vagin
avagin at parallels.com
Fri Jul 12 05:14:04 EDT 2013
On Fri, Jul 12, 2013 at 11:06:20AM +0400, Andrew Vagin wrote:
> Acked-by: Andrew Vagin <avagin at parallels.com>
Nacked
make -C test/zdtm/live/static/ cleanout zombie00.pid
485 ? Ss 0:00 ./zombie00 --pidfile=zombie00.pid --outfile=zombie00.out
486 ? Z 0:00 \_ [zombie00] <defunct>
487 ? Z 0:00 \_ [zombie00] <defunct>
488 ? Z 0:00 \_ [zombie00] <defunct>
489 ? Z 0:00 \_ [zombie00] <defunct>
./crtools dump -t 485
./crtools restore -t 485
522 pts/0 T 0:00 \_ ./crtools restore -t 485
485 ? Ss 0:00 | \_ ./zombie00 --pidfile=zombie00.pid --outfile=zombie00.out
489 ? Z 0:00 | \_ [] <defunct>
486 ? Z 0:00 | \_ [] <defunct>
487 ? Z 0:00 | \_ [] <defunct>
488 ? Z 0:00 | \_ [] <defunct>
491 pts/0 R+ 0:00 \_ ps axf
# ./crtools show -f core-488.img
mtype: X86_64
tc: {
task_state: 0x2
exit_code: 0x9
personality: 0
flags: 0
blk_sigset: 0000000000000000
comm: ""
}
The image doesn't contain comm
>
> On Fri, Jul 12, 2013 at 10:07:46AM +0400, Cyrill Gorcunov wrote:
> > | 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