Skip to contentSkip to conversation

Paravirt framebuffer: Use only if requested [6/6]

PATCH In review Jeremy Katz 2 participants 3 messages Aug 18, 2006 – Aug 21, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Paravirt framebuffer: Use only if requested [6/6]

If we're not set up to use a graphical console for the guest, then we need to ensure that the xvc console ends up as the primary console. This also should make it so that we can lose the console_use_vt bits.

Jeremy

#1 lore raw
Quoted 5 lines · Jeremy Katz

If we're not set up to use a graphical console for the guest, then we need to ensure that the xvc console ends up as the primary console. This also should make it so that we can lose the console_use_vt bits.

Helps to attach it...

Jeremy

linux-2.6-xen-sparse/drivers/xen/console/console.c +14 -0
diff -r e1df81251b97 -r fccccf63eb85 linux-2.6-xen-sparse/drivers/xen/console/console.c
@@ -663,6 +663,20 @@ static int __init xencons_init(void)
 	printk("Xen virtual console successfully installed as %s%d\n",
 	       DRV(xencons_driver)->name, xc_num);
 
+        /* Don't need to check about graphical fb for domain 0 */
+        if (is_initial_xendomain())
+	  return 0;
+
+	rc = 0;
+	if (xenbus_scanf(XBT_NIL, "console", "use_graphics", "%d", &rc) < 0)
+		printk(KERN_ERR "Unable to read console/use_graphics\n");
+	if (rc == 0) {
+               /* FIXME: this is ugly */
+	       unregister_console(&kcons_info);
+	       kcons_info.flags |= CON_CONSDEV;
+	       register_console(&kcons_info);
+	}
+
 	return 0;
 }
 
linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c +0 -3
diff -r fccccf63eb85 -r e1f90db3f153 linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c
@@ -1873,9 +1873,6 @@ void __init setup_arch(char **cmdline_p)
 	} else {
 #if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE)
 		conswitchp = &dummy_con;
-#else
-		extern int console_use_vt;
-		console_use_vt = 0;
 #endif
 	}
 }
linux-2.6-xen-sparse/drivers/char/tty_io.c +1 -5
diff -r fccccf63eb85 -r e1f90db3f153 linux-2.6-xen-sparse/drivers/char/tty_io.c
@@ -132,8 +132,6 @@ LIST_HEAD(tty_drivers);			/* linked list
    vt.c for deeply disgusting hack reasons */
 DECLARE_MUTEX(tty_sem);
 
-int console_use_vt = 1;
-
 #ifdef CONFIG_UNIX98_PTYS
 extern struct tty_driver *ptm_driver;	/* Unix98 pty masters; for /dev/ptmx */
 extern int pty_limit;		/* Config limit on Unix98 ptys */
@@ -2056,7 +2054,7 @@ retry_open:
 		goto got_driver;
 	}
 #ifdef CONFIG_VT
-	if (console_use_vt && (device == MKDEV(TTY_MAJOR,0))) {
+	if (device == MKDEV(TTY_MAJOR,0)) {
 		extern struct tty_driver *console_driver;
 		driver = console_driver;
 		index = fg_console;
@@ -3243,8 +3241,6 @@ static int __init tty_init(void)
 #endif
 
 #ifdef CONFIG_VT
-	if (!console_use_vt)
-		goto out_vt;
 	cdev_init(&vc0_cdev, &console_fops);
 	if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) ||
 	    register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 6 lines · Jeremy Katz
Quoted 5 lines · Jeremy Katz

If we're not set up to use a graphical console for the guest, then we need to ensure that the xvc console ends up as the primary console. This also should make it so that we can lose the console_use_vt bits.

[...]

linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c void __init setup_arch(char **cmdline_p) · line 1878

Quoted 13 lines

diff -r fccccf63eb85 -r e1f90db3f153 linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c

linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c +0 -3
@@ -1873,9 +1873,6 @@ void __init setup_arch(char **cmdline_p)
 	} else {
 #if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE)
 		conswitchp = &dummy_con;
-#else
-		extern int console_use_vt;
-		console_use_vt = 0;
 #endif
 	}
 }

Same change to arch/ia64/kernel/setup.c and
arch/x86_64/kernel/setup-xen.c.