[CRIU] Re: [PATCH 4/4] tty, restore: Migrate tty slave peer connection if --shell-job passed

Cyrill Gorcunov gorcunov at openvz.org
Thu Oct 18 06:02:39 EDT 2012


On Thu, Oct 18, 2012 at 01:58:21PM +0400, Pavel Emelyanov wrote:
> > @@ -86,6 +86,8 @@ static LIST_HEAD(all_tty_info_entries);
> >  static LIST_HEAD(all_ttys);
> >  static int self_stdin = -1;
> >  
> > +#define INHERIT_SID			(-1)
> > +
> >  /*
> >   * Usually an application has not that many ttys opened.
> >   * If this won't be enough in future we simply need to
> 
> Last question -- why not make the tty's sid/pgid logic the same as it is
> for task sids and pgids, i.e. -- save IDs as is, but fix them up on restore?

This patch does exactly that. We fix sid/pgid on restore if migrate tty.

tty_find_restoring_task
	if (opts.shell_job && !pty_is_master(info)) {
		info->tie->sid = info->tie->pgrp = INHERIT_SID;
		return 0;
	}



More information about the CRIU mailing list