From: Mark McLoughlin Subject: Re: [PATCH] xenconsole: fix xencons=tty[0-9]+ param Date: Sun, 02 Jul 2006 16:11:44 +0100 Message-ID: <1151853104.4066.14.camel@localhost.localdomain> References: <1151686608.6184.67.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-z1Bp+yhhXrjQVZoc/Zja" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=-z1Bp+yhhXrjQVZoc/Zja Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi, On Fri, 2006-06-30 at 18:31 +0100, Keir Fraser wrote: > On 30 Jun 2006, at 17:56, Mark McLoughlin wrote: > > > If you boot with e.g. xencons=tty3, then tty1/tty2 aren't valid > > devices. > > > > Attached patch makes it always create valid devices on tty1-tty63, but > > all but the one specified by xencons are dummy devices. > > Is your change to ttyS correct for anything other than ttyS0? Looks > like you'd incorrectly bind on ttyS0. > > Also I see you made a predicate more complicated which is repeated many > times. Could you hide it behind a suitably named macro? You may need to > make it more complicated still to fix ttyS case... Good points. How about this? Thanks, Mark. --=-z1Bp+yhhXrjQVZoc/Zja Content-Disposition: attachment; filename=xenconsole.patch Content-Type: text/x-patch; name=xenconsole.patch; charset=utf-8 Content-Transfer-Encoding: 7bit --- ./linux-2.6.16.x86_64/drivers/xen/console/console.c.xencons 2006-06-28 13:11:58.000000000 +0100 +++ ./linux-2.6.16.x86_64/drivers/xen/console/console.c 2006-07-02 17:05:58.000000000 +0100 @@ -267,7 +267,7 @@ /******************** User-space console driver (/dev/console) ************/ #define DRV(_d) (_d) -#define TTY_INDEX(_tty) ((_tty)->index) +#define DUMMY_TTY(_tty) (xc_mode != XC_SERIAL && (_tty)->index != (xc_num - 1)) static struct termios *xencons_termios[MAX_NR_CONSOLES]; static struct termios *xencons_termios_locked[MAX_NR_CONSOLES]; @@ -391,7 +391,7 @@ { unsigned long flags; - if (TTY_INDEX(tty) != 0) + if (DUMMY_TTY(tty)) return; spin_lock_irqsave(&xencons_lock, flags); @@ -402,7 +402,7 @@ static void xencons_throttle(struct tty_struct *tty) { - if (TTY_INDEX(tty) != 0) + if (DUMMY_TTY(tty)) return; if (I_IXOFF(tty)) @@ -411,7 +411,7 @@ static void xencons_unthrottle(struct tty_struct *tty) { - if (TTY_INDEX(tty) != 0) + if (DUMMY_TTY(tty)) return; if (I_IXOFF(tty)) { @@ -426,7 +426,7 @@ { unsigned long flags; - if (TTY_INDEX(tty) != 0) + if (DUMMY_TTY(tty)) return; spin_lock_irqsave(&xencons_lock, flags); @@ -451,7 +451,7 @@ int i; unsigned long flags; - if (TTY_INDEX(tty) != 0) + if (DUMMY_TTY(tty)) return count; spin_lock_irqsave(&xencons_lock, flags); @@ -472,7 +472,7 @@ { unsigned long flags; - if (TTY_INDEX(tty) != 0) + if (DUMMY_TTY(tty)) return; spin_lock_irqsave(&xencons_lock, flags); @@ -484,7 +484,7 @@ { unsigned long flags; - if (TTY_INDEX(tty) != 0) + if (DUMMY_TTY(tty)) return; spin_lock_irqsave(&xencons_lock, flags); @@ -496,7 +496,7 @@ { unsigned long orig_jiffies = jiffies; - if (TTY_INDEX(tty) != 0) + if (DUMMY_TTY(tty)) return; while (DRV(tty->driver)->chars_in_buffer(tty)) { @@ -515,7 +515,7 @@ { unsigned long flags; - if (TTY_INDEX(tty) != 0) + if (DUMMY_TTY(tty)) return 0; spin_lock_irqsave(&xencons_lock, flags); @@ -532,7 +532,7 @@ { unsigned long flags; - if (TTY_INDEX(tty) != 0) + if (DUMMY_TTY(tty)) return; if (tty->count == 1) { @@ -599,8 +599,8 @@ 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; + DRV(xencons_driver)->minor_start = 1; + DRV(xencons_driver)->name_base = 1; } tty_set_operations(xencons_driver, &xencons_ops); @@ -615,7 +615,7 @@ return rc; } - tty_register_device(xencons_driver, 0, NULL); + tty_register_device(xencons_driver, XC_SERIAL ? 0 : xc_num - 1, NULL); if (xen_start_info->flags & SIF_INITDOMAIN) { xencons_priv_irq = bind_virq_to_irqhandler( @@ -629,8 +629,7 @@ } printk("Xen virtual console successfully installed as %s%d\n", - DRV(xencons_driver)->name, - DRV(xencons_driver)->name_base ); + DRV(xencons_driver)->name, xc_num); return 0; } --=-z1Bp+yhhXrjQVZoc/Zja Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-z1Bp+yhhXrjQVZoc/Zja--