From: Mark McLoughlin <markmc@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: linux-kernel@vger.kernel.org, virtualization@lists.osdl.org,
xen-devel@lists.xensource.com,
linux-fbdev-devel@lists.sourceforge.net, adaplas@pol.net,
Jeremy Fitzhardinge <jeremy@goop.org>,
mingo@redhat.com
Subject: Re: [PATCH] xen: Enable Xen console by default in domU
Date: Fri, 11 Apr 2008 09:52:25 +0100 [thread overview]
Message-ID: <1207903945.26445.4.camel@muff> (raw)
In-Reply-To: <87d4oxvhk0.fsf@pike.pond.sub.org>
On Thu, 2008-04-10 at 17:46 +0200, Markus Armbruster wrote:
...
> Problem: when tty registers, we can't yet know whether the PVFB is
> enabled. By the time we can know (xenstore is up), the console setup
> game is over.
>
> Enable the Xen console hvc by default, and make it the preferred
> console. Change the preferred console to tty when PVFB probes
> successfully, unless we've been given console kernel parameters.
...
> The previous version of this patch had the PVFB change the preferred
> console *always*. That's wrong, because it blithely overwrites any
> preferred console the user might have set up with console kernel
> parameters. Unfortunately, I couldn't see how to fix that cleanly
> without messing with printk.c. If you can think of a better way, let
> me know.
...
> --- a/drivers/video/xen-fbfront.c
> +++ b/drivers/video/xen-fbfront.c
> @@ -358,6 +361,28 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
> return ret;
> }
>
> +static __devinit void
> +xenfb_make_preferred_console(void)
> +{
> + struct console *c;
> +
> + if (console_set_on_cmdline)
> + return;
> +
> + acquire_console_sem();
> + for (c = console_drivers; c; c = c->next) {
> + if (!strcmp(c->name, "tty") && c->index == 0)
> + break;
> + }
How about adding a new console flag so that e.g. you could do:
if (!strcmp(c->name, "tty") && c->index == 0 &&
!(c->flags & CON_SET_ON_CMDLINE))
break;
> + release_console_sem();
> + if (c) {
> + unregister_console(c);
> + c->flags |= CON_CONSDEV;
> + c->flags &= ~CON_PRINTBUFFER; /* don't print again */
> + register_console(c);
> + }
> +}
> +
...
> --- a/include/linux/console.h
> +++ b/include/linux/console.h
> @@ -107,6 +107,8 @@ struct console {
> struct console *next;
> };
>
> +extern int console_set_on_cmdline;
> +
> extern int add_preferred_console(char *name, int idx, char *options);
> extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options);
> extern void register_console(struct console *);
> diff --git a/kernel/printk.c b/kernel/printk.c
> index c46a20a..c07bfc1 100644
> --- a/kernel/printk.c
> +++ b/kernel/printk.c
> @@ -118,6 +118,7 @@ struct console_cmdline
> static struct console_cmdline console_cmdline[MAX_CMDLINECONSOLES];
> static int selected_console = -1;
> static int preferred_console = -1;
> +int console_set_on_cmdline;
>
> /* Flag: console code may call schedule() */
> static int console_may_schedule;
> @@ -829,6 +830,7 @@ static int __init console_setup(char *str)
> *s = 0;
>
> add_preferred_console(buf, idx, options);
> + console_set_on_cmdline = 1;
> return 1;
> }
> __setup("console=", console_setup);
next prev parent reply other threads:[~2008-04-11 8:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87hcehshyc.fsf@pike.pond.sub.org>
2008-04-10 15:46 ` [PATCH] xen: Enable Xen console by default in domU Markus Armbruster
2008-04-11 8:52 ` Mark McLoughlin [this message]
2008-04-11 8:59 ` Mark McLoughlin
2008-04-04 14:59 Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1207903945.26445.4.camel@muff \
--to=markmc@redhat.com \
--cc=adaplas@pol.net \
--cc=armbru@redhat.com \
--cc=jeremy@goop.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=virtualization@lists.osdl.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).