[CRIU] [PATCH 03/11] tty: Introduce dump_one_tty helper

Cyrill Gorcunov gorcunov at gmail.com
Wed Oct 1 08:03:08 PDT 2014


On Wed, Oct 01, 2014 at 06:51:26PM +0400, Andrew Vagin wrote:
> On Mon, Sep 29, 2014 at 08:25:29PM +0400, Cyrill Gorcunov wrote:
> > Depending on tty major/minor numbers we will
> > need different dumping routines so choose one
> > here.
> > 
> > Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> > ---
> >  tty.c | 33 +++++++++++++++++++++++++++------
> >  1 file changed, 27 insertions(+), 6 deletions(-)
> > 
> > diff --git a/tty.c b/tty.c
> > index 309d28c3a024..770056934f28 100644
> > --- a/tty.c
> > +++ b/tty.c
> > @@ -1160,14 +1160,11 @@ out:
> >  	return ret;
> >  }
> >  
> > -static int dump_one_pty(int lfd, u32 id, const struct fd_parms *p)
> > +static int dump_one_pty(int lfd, u32 id, const struct fd_parms *p, int major, int minor)
> >  {
> 
> minor is not used here.

		ret = dump_pty_info(lfd, e.tty_info_id, p, major, minor, index);

I need this minor in callee

> > +
> > +	switch (major) {
> > +	case TTYAUX_MAJOR:
> > +		if (minor == 0 || minor == 2)
> 
> Which devices has these numbers?

	register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty")
	register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx");

> > +			return dump_one_pty(lfd, id, p, major, minor);
> > +		break;
> > +	case UNIX98_PTY_MASTER_MAJOR ... (UNIX98_PTY_MASTER_MAJOR + UNIX98_PTY_MAJOR_COUNT - 1):
> > +	case UNIX98_PTY_SLAVE_MAJOR:
> > +		return dump_one_pty(lfd, id, p, major, minor);
> > +	default:
> > +		break;
> > +	}
> > +


More information about the CRIU mailing list