[CRIU] Re: [PATCH 6/6] tty: Migrate tty slave peer connections

Cyrill Gorcunov gorcunov at openvz.org
Wed Sep 26 09:46:43 EDT 2012


On Wed, Sep 26, 2012 at 05:30:37PM +0400, Andrew Vagin wrote:
> > 
> > diff --git a/include/tty.h b/include/tty.h
> > index 982bffb..6e12ccb 100644
> > --- a/include/tty.h
> > +++ b/include/tty.h
> > @@ -12,6 +12,7 @@
> >  # define PTMX_MINOR 2
> >  #endif
> >  #define PTS_FMT		"/dev/pts/%d"
> > +#define PTS_CURRENT	"/dev/tty"
> 
> I don't like /dev/tty, because in this case we can make dump/restore
> only once. Pavel suggested to get terminal from crtools. If you don't
> like this idea, you can get a current tty by the same way as "ps".

I'm moving code to new base now which will not use /dev/tty, thanks!

> > -	pr_err("No task found with sid %d\n", info->tie->sid);
> > -	return -1;
> > +	/*
> > +	 * OK, no proper SID found, this means we were dumped as
> > +	 * a part of some other session and can't restore the session
> > +	 * needed back.
> > +	 *
> > +	 * To workaround this just reset SID to the process root SID,
> > +	 * there nothing else we can do.
> > +	 */
> > +
> > +	pr_warn("No task found with sid %d, reset constrol terminal to sid %d\n",
> > +		info->tie->sid, root_item->sid);
> > +
> > +	info->tie->sid = root_item->sid;
> > +	info->tie->pgrp = root_item->pgid;
> > +
> > +	return prepare_ctl_tty(root_item->pid.virt, item->rst, info->tfe->id);
> I don't understand this part. Is this terminal external? If it's true,
> why do we need to call prepare_ctl_tty() in this case?

This should be left from previous attmepts, i'll update.


More information about the CRIU mailing list