[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] xencons: further Dom0 handling improvements


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
  • Date: Mon, 17 Feb 2014 11:44:02 +0000
  • Delivery-date: Mon, 17 Feb 2014 11:44:38 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1392636816 -3600
# Node ID c319bf65ef0495756ee9cc340ba7cb2e3388027e
# Parent  ac24179a78750ed99a8bee90e523af7c28962b3f
xencons: further Dom0 handling improvements

c/s 1242:731ff1f10c46 ("xencons: generalize use of
add_preferred_console()") still left cases where (in Dom0) the console
would get registered with index -1. Eliminate these cases by
- also calling add_preferred_console() in Dom0 when "xencons=" was
  specified
- setting the index directly when in Dom0 and "xencons=" was not given

Also do some cleanup:
- Move the declaration of console_use_vt into the respective global
  header (where it should have been placed from the beginning), and
  use a #define instead of a variable when !XEN.
- Replace the needless uses of goto in xen_console_init() with plain
  return statements.

Reported-by: Olaf Hering <olaf@xxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---


diff -r ac24179a7875 -r c319bf65ef04 drivers/char/tty_io.c
--- a/drivers/char/tty_io.c     Tue Jan 28 15:00:11 2014 +0100
+++ b/drivers/char/tty_io.c     Mon Feb 17 12:33:36 2014 +0100
@@ -130,7 +130,9 @@ LIST_HEAD(tty_drivers);                     /* linked list
    vt.c for deeply disgusting hack reasons */
 DEFINE_MUTEX(tty_mutex);
 
+#ifndef console_use_vt
 int console_use_vt = 1;
+#endif
 
 #ifdef CONFIG_UNIX98_PTYS
 extern struct tty_driver *ptm_driver;  /* Unix98 pty masters; for /dev/ptmx */
diff -r ac24179a7875 -r c319bf65ef04 drivers/xen/console/console.c
--- a/drivers/xen/console/console.c     Tue Jan 28 15:00:11 2014 +0100
+++ b/drivers/xen/console/console.c     Mon Feb 17 12:33:36 2014 +0100
@@ -86,9 +86,8 @@ static int __init xencons_setup(char *st
 {
        char *q;
        int n;
-       extern int console_use_vt;
 
-       console_use_vt = 1;
+       console_use_vt = -1;
        if (!strncmp(str, "ttyS", 4)) {
                xc_mode = XC_SERIAL;
                str += 4;
@@ -193,13 +192,13 @@ static struct console kcons_info = {
 static int __init xen_console_init(void)
 {
        if (!is_running_on_xen())
-               goto out;
+               return 0;
 
        if (is_initial_xendomain()) {
                kcons_info.write = kcons_write_dom0;
        } else {
                if (!xen_start_info->console.domU.evtchn)
-                       goto out;
+                       return 0;
                kcons_info.write = kcons_write;
        }
 
@@ -229,16 +228,17 @@ static int __init xen_console_init(void)
                break;
 
        default:
-               goto out;
+               return 0;
        }
 
        wbuf = alloc_bootmem(wbuf_size);
 
-       if (!is_initial_xendomain())
+       if (console_use_vt <= 0 || !is_initial_xendomain())
                add_preferred_console(kcons_info.name, xc_num, NULL);
+       else
+               kcons_info.index = xc_num;
        register_console(&kcons_info);
 
- out:
        return 0;
 }
 console_initcall(xen_console_init);
diff -r ac24179a7875 -r c319bf65ef04 include/linux/console.h
--- a/include/linux/console.h   Tue Jan 28 15:00:11 2014 +0100
+++ b/include/linux/console.h   Mon Feb 17 12:33:36 2014 +0100
@@ -63,6 +63,12 @@ extern const struct consw vga_con;   /* VG
 extern const struct consw newport_con; /* SGI Newport console  */
 extern const struct consw prom_con;    /* SPARC PROM console */
 
+#ifdef CONFIG_XEN
+extern int console_use_vt;
+#else
+#define console_use_vt 1
+#endif
+
 int con_is_bound(const struct consw *csw);
 int register_con_driver(const struct consw *csw, int first, int last);
 int unregister_con_driver(const struct consw *csw);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.