[CRIU] Re: [PATCH 14/14] tty, restore: Migrate tty slave peer connection

Cyrill Gorcunov gorcunov at openvz.org
Mon Oct 15 12:20:50 EDT 2012


On Mon, Oct 15, 2012 at 08:12:33PM +0400, Pavel Emelyanov wrote:
> > +	if (likely(slave->tie->termios)) {
> > +		fd = dup(get_service_fd(SELF_STDIN_OFF));
> > +		if (fd < 0) {
> > +			pr_perror("Can't dup SELF_STDIN_OFF");
> > +			return -1;
> > +		}
> > +		pr_info("Migrated slave peer %x -> to fd %d\n",
> > +			slave->tfe->id, fd);
> 
> Presence of termios on _proper_ slaves denotes a corruption in the image. You turn
> this into a sign that a slave is unpaired, which is wrong.

Look, this routine is called IIF there is NO master peer on this index,
thus you can't reach this point if you have appropriate master peer.

Letme explain. When we collect ttys we stack them into a list of siblings
(where affinity is denoted by peer index). Once all sliblings are coupled
the all_tty list consist of orphan items. Thus, since we know they are
orphans - two situation possible, some of them might require fake master
peer (the case when @termios is no presented) and some of them are
simply should be inherited from the crtools itself (@termios present).


More information about the CRIU mailing list