diff options
author | Markus Armbruster <armbru@redhat.com> | 2008-05-26 18:31:07 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-27 04:11:36 -0400 |
commit | 9e124fe16ff24746d6de5a2ad685266d7bce0e08 (patch) | |
tree | 6be2bf0edd3799170c74f3fff15f1adf14e0380b /drivers/video/xen-fbfront.c | |
parent | a15af1c9ea2750a9ff01e51615c45950bad8221b (diff) |
xen: Enable console tty by default in domU if it's not a dummy
Without console= arguments on the kernel command line, the first
console to register becomes enabled and the preferred console (the one
behind /dev/console). This is normally tty (assuming
CONFIG_VT_CONSOLE is enabled, which it commonly is).
This is okay as long tty is a useful console. But unless we have the
PV framebuffer, and it is enabled for this domain, tty0 in domU is
merely a dummy. In that case, we want the preferred console to be the
Xen console hvc0, and we want it without having to fiddle with the
kernel command line. Commit b8c2d3dfbc117dff26058fbac316b8acfc2cb5f7
did that for us.
Since we now have the PV framebuffer, we want to enable and prefer tty
again, but only when PVFB is enabled. But even then we still want to
enable the Xen console as well.
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.
Solution: enable console tty by default, but keep hvc as the preferred
console. Change the preferred console to tty when PVFB probes
successfully, unless we've been given console kernel parameters.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/video/xen-fbfront.c')
-rw-r--r-- | drivers/video/xen-fbfront.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c index 619a6f8d65a2..4e10876e62fc 100644 --- a/drivers/video/xen-fbfront.c +++ b/drivers/video/xen-fbfront.c | |||
@@ -18,6 +18,7 @@ | |||
18 | * frame buffer. | 18 | * frame buffer. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <linux/console.h> | ||
21 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
22 | #include <linux/errno.h> | 23 | #include <linux/errno.h> |
23 | #include <linux/fb.h> | 24 | #include <linux/fb.h> |
@@ -48,6 +49,7 @@ struct xenfb_info { | |||
48 | 49 | ||
49 | static u32 xenfb_mem_len = XENFB_WIDTH * XENFB_HEIGHT * XENFB_DEPTH / 8; | 50 | static u32 xenfb_mem_len = XENFB_WIDTH * XENFB_HEIGHT * XENFB_DEPTH / 8; |
50 | 51 | ||
52 | static void xenfb_make_preferred_console(void); | ||
51 | static int xenfb_remove(struct xenbus_device *); | 53 | static int xenfb_remove(struct xenbus_device *); |
52 | static void xenfb_init_shared_page(struct xenfb_info *); | 54 | static void xenfb_init_shared_page(struct xenfb_info *); |
53 | static int xenfb_connect_backend(struct xenbus_device *, struct xenfb_info *); | 55 | static int xenfb_connect_backend(struct xenbus_device *, struct xenfb_info *); |
@@ -348,6 +350,7 @@ static int __devinit xenfb_probe(struct xenbus_device *dev, | |||
348 | if (ret < 0) | 350 | if (ret < 0) |
349 | goto error; | 351 | goto error; |
350 | 352 | ||
353 | xenfb_make_preferred_console(); | ||
351 | return 0; | 354 | return 0; |
352 | 355 | ||
353 | error_nomem: | 356 | error_nomem: |
@@ -358,6 +361,28 @@ static int __devinit xenfb_probe(struct xenbus_device *dev, | |||
358 | return ret; | 361 | return ret; |
359 | } | 362 | } |
360 | 363 | ||
364 | static __devinit void | ||
365 | xenfb_make_preferred_console(void) | ||
366 | { | ||
367 | struct console *c; | ||
368 | |||
369 | if (console_set_on_cmdline) | ||
370 | return; | ||
371 | |||
372 | acquire_console_sem(); | ||
373 | for (c = console_drivers; c; c = c->next) { | ||
374 | if (!strcmp(c->name, "tty") && c->index == 0) | ||
375 | break; | ||
376 | } | ||
377 | release_console_sem(); | ||
378 | if (c) { | ||
379 | unregister_console(c); | ||
380 | c->flags |= CON_CONSDEV; | ||
381 | c->flags &= ~CON_PRINTBUFFER; /* don't print again */ | ||
382 | register_console(c); | ||
383 | } | ||
384 | } | ||
385 | |||
361 | static int xenfb_resume(struct xenbus_device *dev) | 386 | static int xenfb_resume(struct xenbus_device *dev) |
362 | { | 387 | { |
363 | struct xenfb_info *info = dev->dev.driver_data; | 388 | struct xenfb_info *info = dev->dev.driver_data; |