mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Pratt <Ian.Pratt@cl.cam.ac.uk>
To: Ian Pratt <Ian.Pratt@cl.cam.ac.uk>
Cc: linux-kernel@vger.kernel.org, Steven.Hand@cl.cam.ac.uk,
	Christian.Limpach@cl.cam.ac.uk, Keir.Fraser@cl.cam.ac.uk,
	alan@redhat.com
Subject: [3/7] Xen VMM patch set : runtime disable of VT console
Date: Fri, 19 Nov 2004 23:21:51 +0000	[thread overview]
Message-ID: <E1CVI4e-0004aW-00@mta1.cl.cam.ac.uk> (raw)
In-Reply-To: Your message of "Fri, 19 Nov 2004 23:16:33 GMT." <E1CVHzW-0004XC-00@mta1.cl.cam.ac.uk>


This patch enables the VT console to be disabled at runtime even if it
is built into the kernel. Arch xen needs this to avoid trying to
initialise a VT in virtual machine that doesn't have access to the
console hardware.

Signed-off-by: ian.pratt@cl.cam.ac.uk

---


diff -Nurp pristine-linux-2.6.10-rc2/drivers/char/tty_io.c tmp-linux-2.6.10-rc2-xen.patch/drivers/char/tty_io.c
--- pristine-linux-2.6.10-rc2/drivers/char/tty_io.c	2004-11-15 01:27:52.000000000 +0000
+++ tmp-linux-2.6.10-rc2-xen.patch/drivers/char/tty_io.c	2004-11-18 20:10:26.000000000 +0000
@@ -131,6 +131,8 @@ 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 */
@@ -2964,14 +2966,19 @@ static int __init tty_init(void)
 #endif
 
 #ifdef CONFIG_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)
-		panic("Couldn't register /dev/tty0 driver\n");
-	devfs_mk_cdev(MKDEV(TTY_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vc/0");
-	class_simple_device_add(tty_class, MKDEV(TTY_MAJOR, 0), NULL, "tty0");
+	if (console_use_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)
+			panic("Couldn't register /dev/tty0 driver\n");
+		devfs_mk_cdev(MKDEV(TTY_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR,
+			      "vc/0");
+		class_simple_device_add(tty_class, MKDEV(TTY_MAJOR, 0), NULL,
+					"tty0");
 
-	vty_init();
+		vty_init();
+	}
 #endif
 	return 0;
 }

  parent reply	other threads:[~2004-11-19 23:24 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-19 23:16 Xen VMM patch set - take 2 Ian Pratt
2004-11-19 23:20 ` [1/7] Xen VMM patch set : add ptep_establish_new to make va available Ian Pratt
2004-11-19 23:20 ` [2/7] Xen VMM patch set : return code for arch_free_page Ian Pratt
2004-11-30  2:28   ` Andrea Arcangeli
2004-11-19 23:21 ` Ian Pratt [this message]
2004-11-19 23:22 ` [4/7] Xen VMM patch set : /dev/mem io_remap_page_range for CONFIG_XEN Ian Pratt
2004-11-20  2:03   ` William Lee Irwin III
2004-11-20 16:31   ` Christoph Hellwig
2004-11-20 18:03     ` Ian Pratt
2004-11-27 12:39       ` Ian Pratt
2004-11-27 16:51         ` Randy.Dunlap
2004-11-30  3:08   ` Andrea Arcangeli
2004-11-30  3:14     ` David S. Miller
2004-11-30  3:38     ` William Lee Irwin III
2004-11-30  8:56     ` Ian Pratt
2004-11-30  9:04       ` Arjan van de Ven
2004-11-30 12:09         ` Ian Pratt
2004-11-30 12:14           ` Arjan van de Ven
2004-11-30 12:18             ` Arjan van de Ven
2004-11-30 13:16             ` Ian Pratt
2004-11-30 18:03               ` Andrea Arcangeli
2004-12-04 23:49                 ` Ian Pratt
2004-12-05  0:40                   ` Andrea Arcangeli
2004-12-05  2:47                   ` William Lee Irwin III
2004-11-19 23:23 ` [5/7] Xen VMM patch set : split free_irq into teardown_irq Ian Pratt
2004-11-20 16:32   ` Christoph Hellwig
2004-11-20 19:20     ` Ian Pratt
2004-11-27 12:45       ` Ian Pratt
2004-11-19 23:25 ` [6/7] Xen VMM patch set : add alloc_skb_from_cache Ian Pratt
2004-11-20  2:11   ` James Morris
2004-11-20  6:03     ` Chris Wedgwood
2004-11-20  6:47       ` David S. Miller
2004-11-20 10:28       ` Keir Fraser
2004-11-20 10:33         ` Chris Wedgwood
2004-11-19 23:28 ` [7/7] Xen VMM patch set : handle fragemented skbs correctly in icmp_filter Ian Pratt
2004-11-25 15:46 ` Xen VMM patch set - take 2 Ian Pratt
2004-11-28 17:07   ` Rik van Riel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1CVI4e-0004aW-00@mta1.cl.cam.ac.uk \
    --to=ian.pratt@cl.cam.ac.uk \
    --cc=Christian.Limpach@cl.cam.ac.uk \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=Steven.Hand@cl.cam.ac.uk \
    --cc=alan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®