@@ -554,6 +554,22 @@ static void console_find_owner(void)
console_set_owner(DOMID_XEN);
}
+static void console_init_owner(void)
+{
+ domid_t domid;
+
+ /*
+ * If user specifies so, we fool the switch routine to redirect input
+ * straight back to Xen.
+ */
+ if ( opt_conswitch[1] == 'x' )
+ domid = DOMID_XEN;
+ else
+ domid = get_initial_domain_id();
+
+ console_set_owner(domid);
+}
+
static void __serial_rx(char c)
{
switch ( console_owner )
@@ -1143,14 +1159,6 @@ void __init console_endboot(void)
video_endboot();
- /*
- * If user specifies so, we fool the switch routine to redirect input
- * straight back to Xen. I use this convoluted method so we still print
- * a useful 'how to switch' message.
- */
- if ( opt_conswitch[1] == 'x' )
- console_owner = DOMID_XEN;
-
register_keyhandler('w', dump_console_ring_key,
"synchronously dump console ring buffer (dmesg)", 0);
register_irq_keyhandler('+', &do_inc_thresh,
@@ -1160,8 +1168,7 @@ void __init console_endboot(void)
register_irq_keyhandler('G', &do_toggle_guest,
"toggle host/guest log level adjustment", 0);
- /* Serial input is directed to DOM0 by default. */
- console_find_owner();
+ console_init_owner();
}
int __init console_has(const char *device)