[PATCH 1/5] xen: Enable console tty by default in domU if it's not a dummy

Previous thread: [PATCH] MAINTAINERS: Add util-lilnux-ng package by Karel Zak on Wednesday, May 21, 2008 - 4:18 am. (1 message)

Next thread: [PATCH 2/5] xen pvfb: Pointer z-axis (mouse wheel) support by Markus Armbruster on Wednesday, May 21, 2008 - 4:39 am. (1 message)
To: <linux-kernel@...>
Cc: <virtualization@...>, Jeremy Fitzhardinge <jeremy@...>, <xen-devel@...>, <linux-fbdev-devel@...>, <adaplas@...>, <linux-input@...>, <dmitry.torokhov@...>, <mingo@...>, <akpm@...>, Pat Campbell <plc@...>
Date: Wednesday, May 21, 2008 - 4:38 am

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>
---
arch/x86/xen/enlighten.c | 4 +++-
drivers/video/xen-fbfront.c | 25 +++++++++++++++++++++++++
include/linux/console.h | 2 ++
kernel/printk.c | 3 +++
4 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index c8a56e4..a9f8d6a 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1242,8 +1242,10 @@ asmlinkage void __init xen_start_kernel(void)
? __pa(xen_start_info->mod_start) : 0;
boot_params.hdr.ramdisk_size = xen_start_info->mod_len;

- if (!is_initial_xendomain())
+ if (!is_initial_xendomain()) {
+ add_preferred_console("tty", 0, NULL);
add_preferred_console("hvc", 0, NULL);
+ }

/* Start the world */
start_kernel();
diff --git a/drivers/video/xen-fbfront.c...

To: Markus Armbruster <armbru@...>
Cc: <linux-kernel@...>, <virtualization@...>, <jeremy@...>, <xen-devel@...>, <linux-fbdev-devel@...>, <adaplas@...>, <linux-input@...>, <dmitry.torokhov@...>, <mingo@...>, <plc@...>
Date: Wednesday, May 21, 2008 - 8:26 pm

On Wed, 21 May 2008 10:38:50 +0200

What a stunningly good changelog - I'd buy the tee-shirt.

Ack on the non-xen bits.
--

Previous thread: [PATCH] MAINTAINERS: Add util-lilnux-ng package by Karel Zak on Wednesday, May 21, 2008 - 4:18 am. (1 message)

Next thread: [PATCH 2/5] xen pvfb: Pointer z-axis (mouse wheel) support by Markus Armbruster on Wednesday, May 21, 2008 - 4:39 am. (1 message)