- Update Xen patches to 3.3-rc5 and c/s 1157.
[linux-flexiantxendom0-3.2.10.git] / drivers / tty / tty_io.c
index e41b9bb..8a01193 100644 (file)
@@ -138,6 +138,8 @@ EXPORT_SYMBOL(tty_mutex);
 /* Spinlock to protect the tty->tty_files list */
 DEFINE_SPINLOCK(tty_files_lock);
 
+bool __read_mostly console_use_vt = true;
+
 static ssize_t tty_read(struct file *, char __user *, size_t, loff_t *);
 static ssize_t tty_write(struct file *, const char __user *, size_t, loff_t *);
 ssize_t redirected_tty_write(struct file *, const char __user *,
@@ -1854,6 +1856,10 @@ static struct tty_driver *tty_lookup_driver(dev_t device, struct file *filp,
 #ifdef CONFIG_VT
        case MKDEV(TTY_MAJOR, 0): {
                extern struct tty_driver *console_driver;
+
+               if (!console_use_vt)
+                       return get_tty_driver(device, index)
+                              ?: ERR_PTR(-ENODEV);
                driver = tty_driver_kref_get(console_driver);
                *index = fg_console;
                *noctty = 1;
@@ -3403,7 +3409,8 @@ int __init tty_init(void)
                WARN_ON(device_create_file(consdev, &dev_attr_active) < 0);
 
 #ifdef CONFIG_VT
-       vty_init(&console_fops);
+       if (console_use_vt)
+               vty_init(&console_fops);
 #endif
        return 0;
 }