Mark McLoughlin
2006-Jun-30 16:56 UTC
[Xen-devel] [PATCH] xenconsole: fix xencons=tty[0-9]+ param
Hi, 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. Cheers, Mark. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Jun-30 17:31 UTC
Re: [Xen-devel] [PATCH] xenconsole: fix xencons=tty[0-9]+ param
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... -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Mark McLoughlin
2006-Jul-02 15:11 UTC
Re: [Xen-devel] [PATCH] xenconsole: fix xencons=tty[0-9]+ param
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. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Jul-02 15:39 UTC
Re: [Xen-devel] [PATCH] xenconsole: fix xencons=tty[0-9]+ param
>> 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? >All looks okay except the following change: - tty_register_device(xencons_driver, 0, NULL); + tty_register_device(xencons_driver, XC_SERIAL ? 0 : xc_num - 1, NULL); First, it ought to be (xc_mode == XC_SERIAL) right? Secondly, is registering just one of the tty devices what you want to do? Do you not need to register the ''dummy'' ones for this trick to work? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Mark McLoughlin
2006-Jul-02 16:27 UTC
Re: [Xen-devel] [PATCH] xenconsole: fix xencons=tty[0-9]+ param
On Sun, 2006-07-02 at 16:39 +0100, Keir Fraser wrote:> >> 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? > > > > All looks okay except the following change: > > - tty_register_device(xencons_driver, 0, NULL); > + tty_register_device(xencons_driver, XC_SERIAL ? 0 : xc_num - 1, NULL); > > First, it ought to be (xc_mode == XC_SERIAL) right?Doh, yes.> Secondly, is registering just one of the tty devices what you want to > do? Do you not need to register the ''dummy'' ones for this trick to > work?The previous behaviour was to only register the real tty, so I didn''t want to change that. It seems that tty_register_device() only registers the device with devfs and sysfs. Since we don''t use devfs, I wasn''t seeing any real side effects in testing, but I guess if you''re using devfs you want the dummy devices registered too. Removing the TTY_NO_DEVFS flag so that tty_register_driver() registers the devices automatically seems to be the best thing to do? Cheers, Mark. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel