WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

Re: [XenPPC] [PATCH] xen console driver hijacking TTY_MAJOR

On Tue, 2006-08-01 at 12:14 -0400, Jimi Xenidis wrote:
> On Aug 1, 2006, at 12:08 PM, Hollis Blanchard wrote:
> 
> > On Mon, 2006-07-31 at 21:41 -0400, Amos Waterland wrote:
> >> diff -r 17aa29a18b08 drivers/xen/console/console.c
> >> --- a/drivers/xen/console/console.c        Thu Jul 27 18:57:20 2006 -0400
> >> +++ b/drivers/xen/console/console.c        Mon Jul 31 21:04:17 2006 -0400
> >>
> >
> > I don't understand why you're doing this. The solution is for the
> > console driver to use a new major number.
> 
> Just covering all the bases.
> The goal is to have an intermediary patch the Xen will accpet until  
> they willing to move to a new TTY, they have been awfully quite about  
> this.

So pester them. Nobody's going to do anything about it if they don't
realize it's an issue.

> Ultimately, we'll have a patch that will do the new major number but  
> allow this "bug compatible" to exist as a CONFIG.

The patch is trivial. You can use 240 until someone registers a real
major number. Try this:

diff -r 72c8bc5d88f4 drivers/xen/console/console.c
--- a/drivers/xen/console/console.c     Thu Jun 29 13:04:30 2006 -0400
+++ b/drivers/xen/console/console.c     Tue Aug 01 11:20:08 2006 -0500
@@ -582,7 +582,9 @@ static int __init xencons_init(void)
                return -ENOMEM;

        DRV(xencons_driver)->name            = "xencons";
-       DRV(xencons_driver)->major           = TTY_MAJOR;
+       DRV(xencons_driver)->major           = 240;
+       DRV(xencons_driver)->minor_start     = 0;
+       DRV(xencons_driver)->name_base       = 0;
        DRV(xencons_driver)->type            = TTY_DRIVER_TYPE_SERIAL;
        DRV(xencons_driver)->subtype         = SERIAL_TYPE_NORMAL;
        DRV(xencons_driver)->init_termios    = tty_std_termios;
@@ -593,16 +595,6 @@ static int __init xencons_init(void)
        DRV(xencons_driver)->termios         = xencons_termios;
        DRV(xencons_driver)->termios_locked  = xencons_termios_locked;

-       if (xc_mode == XC_SERIAL) {
-               DRV(xencons_driver)->name        = "ttyS";
-               DRV(xencons_driver)->minor_start = 64 + xc_num;
-               DRV(xencons_driver)->name_base   = 0 + xc_num;
-       } else {
-               DRV(xencons_driver)->name        = "tty";
-               DRV(xencons_driver)->minor_start = xc_num;
-               DRV(xencons_driver)->name_base   = xc_num;
-       }
-
        tty_set_operations(xencons_driver, &xencons_ops);

        if ((rc = tty_register_driver(DRV(xencons_driver))) != 0) {

That should work for you locally. You'll want to add xencons0
to /etc/inittab and /etc/securetty. You may not even have to mknod or
modify udev rules; not sure about that.

Through the wonders of decentralized source management, you can keep
this modification in a local tree indefinitely.

If you want to be more complete for submission on xen-devel, you can
also rip out the xc_num and related initialization and mode logic
earlier in console.c.

Solve the real problem please; don't add hacks to work around hacks.

-- 
Hollis Blanchard
IBM Linux Technology Center


_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel