[Devel] [PATCH RHEL7 COMMIT] ve/tty: Revert custom virtualization
Konstantin Khorenko
khorenko at virtuozzo.com
Mon Jan 25 08:24:00 PST 2016
The commit is pushed to "branch-rh7-3.10.0-327.3.1-vz7.10.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.3.1.vz7.10.6
------>
commit b33bedd37bd6632920c62a0408510c7858ddf4ab
Author: Cyrill Gorcunov <gorcunov at virtuozzo.com>
Date: Mon Jan 25 20:21:08 2016 +0400
ve/tty: Revert custom virtualization
This patch revert the following commits
32261dbb962f56b0
d6f07f1738511f50
ef7194625adefadf
7247bba9402a45c0
996c733ac0f34af0
953017eb9e823785
ee5a5380520330fe
fd19fc2c70ae5da0
24fad9670914d675
a707f641083da9b3
b993de93b347199d
7e96c89806c1671a
making code close to the native shipped with rhel7 kernel.
Initially we've been introducing tty device namespaces where
each tty driver lays inside own device namespace so that
every tty driver data carried own ve reference. This seems
to be unnesessary anymore: access into containers is done
either via Unix98 terminals where each container carries own
copy of devpts filesystem so the kernel can distinguish VEs,
either via virtual terminals (console) which are virtualized
by vtty engine code merged into the kernel where each peer
is assigned into appropriate VE using well known get_exec_ve
helper.
Once merged we need to update @ve.ve.default_sysfs_permissions adding
devices/virtual/tty/console rx
devices/virtual/tty/tty0 rx
...
devices/virtual/tty/tty12 rx
This patch is on top of 968f1ebae74f43c927a208a2b4d1f35b40b4046e
https://jira.sw.ru/browse/PSBM-41804
v2:
- rebase on latest git repo
Signed-off-by: Cyrill Gorcunov <gorcunov at virtuozzo.com>
CC: Vladimir Davydov <vdavydov at virtuozzo.com>
CC: Konstantin Khorenko <khorenko at virtuozzo.com>
CC: Igor Sukhih <igor at parallels.com>
---
drivers/base/core.c | 29 -------
drivers/base/devtmpfs.c | 14 ----
drivers/tty/pty.c | 115 +++-------------------------
drivers/tty/tty_io.c | 184 +++++++--------------------------------------
fs/sysfs/ve.c | 10 ---
include/linux/device.h | 1 -
include/linux/tty.h | 6 --
include/linux/tty_driver.h | 4 -
include/linux/ve.h | 12 ---
kernel/ve/ve.c | 18 -----
10 files changed, 36 insertions(+), 357 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 911bbbe..4a01e48 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1870,35 +1870,6 @@ void device_destroy(struct class *class, dev_t devt)
}
EXPORT_SYMBOL_GPL(device_destroy);
-struct __match_devt_ns_arg {
- dev_t devt;
- void *ns;
-};
-
-static int __match_devt_ns(struct device *dev, const void *data)
-{
- const struct __match_devt_ns_arg *arg = data;
-
- return dev->devt == arg->devt &&
- (!dev->class->namespace ||
- dev->class->namespace(dev) == arg->ns);
-}
-
-void device_destroy_namespace(struct class *class, dev_t devt, void *ns)
-{
- struct __match_devt_ns_arg arg = {
- .devt = devt,
- .ns = ns,
- };
- struct device *dev;
-
- dev = class_find_device(class, NULL, &arg, __match_devt_ns);
- if (dev) {
- put_device(dev);
- device_unregister(dev);
- }
-}
-
/**
* device_rename - renames a device
* @dev: the pointer to the struct device to be renamed
diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
index 92840a0..6b200ca 100644
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
@@ -135,16 +135,6 @@ static inline int is_blockdev(struct device *dev)
static inline int is_blockdev(struct device *dev) { return 0; }
#endif
-#ifdef CONFIG_VE
-static inline int is_ve_dev(struct device *dev)
-{
- return dev->class && dev->class->namespace == ve_namespace &&
- ve_namespace(dev) != get_ve0();
-}
-#else
-static inline int is_ve_dev(struct device *dev) { return 0; }
-#endif
-
int devtmpfs_create_node(struct device *dev)
{
const char *tmp = NULL;
@@ -152,8 +142,6 @@ int devtmpfs_create_node(struct device *dev)
if (!thread)
return 0;
- if (is_ve_dev(dev))
- return 0;
req.mode = 0;
req.uid = GLOBAL_ROOT_UID;
@@ -193,8 +181,6 @@ int devtmpfs_delete_node(struct device *dev)
if (!thread)
return 0;
- if (is_ve_dev(dev))
- return 0;
req.name = device_get_devnode(dev, NULL, NULL, NULL, &tmp);
if (!req.name)
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index a686171..92dd4ae 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -490,35 +490,26 @@ static const struct tty_operations slave_pty_ops_bsd = {
.remove = pty_remove
};
-static int __legacy_pty_init(struct ve_struct *ve, struct tty_driver **pty_driver_p,
- struct tty_driver **pty_slave_driver_p)
+static void __init legacy_pty_init(void)
{
struct tty_driver *pty_driver, *pty_slave_driver;
- int err;
if (legacy_count <= 0)
- return 0;
+ return;
pty_driver = tty_alloc_driver(legacy_count,
TTY_DRIVER_RESET_TERMIOS |
TTY_DRIVER_REAL_RAW |
- TTY_DRIVER_CONTAINERIZED |
TTY_DRIVER_DYNAMIC_ALLOC);
- if (IS_ERR(pty_driver)) {
- printk(KERN_ERR "Couldn't allocate pty driver");
- return PTR_ERR(pty_driver);
- }
+ if (IS_ERR(pty_driver))
+ panic("Couldn't allocate pty driver");
pty_slave_driver = tty_alloc_driver(legacy_count,
TTY_DRIVER_RESET_TERMIOS |
TTY_DRIVER_REAL_RAW |
- TTY_DRIVER_CONTAINERIZED |
TTY_DRIVER_DYNAMIC_ALLOC);
- if (IS_ERR(pty_slave_driver)) {
- printk(KERN_ERR "Couldn't allocate pty slave driver");
- err = PTR_ERR(pty_slave_driver);
- goto err_pty_slave_alloc;
- }
+ if (IS_ERR(pty_slave_driver))
+ panic("Couldn't allocate pty slave driver");
pty_driver->driver_name = "pty_master";
pty_driver->name = "pty";
@@ -534,7 +525,6 @@ static int __legacy_pty_init(struct ve_struct *ve, struct tty_driver **pty_drive
pty_driver->init_termios.c_ispeed = 38400;
pty_driver->init_termios.c_ospeed = 38400;
pty_driver->other = pty_slave_driver;
- pty_driver->ve = ve;
tty_set_operations(pty_driver, &master_pty_ops_bsd);
pty_slave_driver->driver_name = "pty_slave";
@@ -548,71 +538,13 @@ static int __legacy_pty_init(struct ve_struct *ve, struct tty_driver **pty_drive
pty_slave_driver->init_termios.c_ispeed = 38400;
pty_slave_driver->init_termios.c_ospeed = 38400;
pty_slave_driver->other = pty_driver;
- pty_slave_driver->ve = ve;
tty_set_operations(pty_slave_driver, &slave_pty_ops_bsd);
- err = tty_register_driver(pty_driver);
- if (err) {
- printk(KERN_ERR "Couldn't register pty driver");
- goto err_pty_master_register;
- }
-
- err = tty_register_driver(pty_slave_driver);
- if (err) {
- printk(KERN_ERR "Couldn't register pty slave driver");
- goto err_pty_slave_register;
- }
-
- *pty_driver_p = pty_driver;
- *pty_slave_driver_p = pty_slave_driver;
- return 0;
-
-err_pty_slave_register:
- tty_unregister_driver(pty_driver);
-err_pty_master_register:
- put_tty_driver(pty_slave_driver);
-err_pty_slave_alloc:
- put_tty_driver(pty_driver);
- return err;
-}
-
-#ifdef CONFIG_VE
-#include <linux/ve.h>
-
-void ve_legacy_pty_fini(struct ve_struct *ve)
-{
- struct tty_driver *pty_driver = ve->pty_driver;
- struct tty_driver *pty_slave_driver = ve->pty_slave_driver;
-
- ve->pty_driver = NULL;
- ve->pty_slave_driver = NULL;
-
- tty_unregister_driver(pty_slave_driver);
- tty_unregister_driver(pty_driver);
- put_tty_driver(pty_slave_driver);
- put_tty_driver(pty_driver);
-
-}
-
-int ve_legacy_pty_init(struct ve_struct *ve)
-{
- return __legacy_pty_init(ve, &ve->pty_driver, &ve->pty_slave_driver);
-}
-
-static void __init legacy_pty_init(void)
-{
- if (__legacy_pty_init(get_ve0(), &get_ve0()->pty_driver, &get_ve0()->pty_slave_driver))
- panic("Failed to init legacy ptys");
+ if (tty_register_driver(pty_driver))
+ panic("Couldn't register pty driver");
+ if (tty_register_driver(pty_slave_driver))
+ panic("Couldn't register pty slave driver");
}
-#else
-static void __init legacy_pty_init(void)
-{
- struct tty_driver *pty_driver, *pty_slave_driver;
-
- if (__legacy_pty_init(&pty_driver, &pty_slave_driver))
- panic("Failed to init legacy ptys");
-}
-#endif // CONFIG_VE
#else
static inline void legacy_pty_init(void) { }
@@ -818,32 +750,6 @@ err_file:
return retval;
}
-static int ve_unix98_pty_init(void *data)
-{
- struct ve_struct *ve = data;
- struct device *dev;
-
- dev = device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 2), ve, "ptmx");
- if (IS_ERR(dev)) {
- pr_warn("Failed to create ptmx device for ve %s: %ld\n",
- ve->ve_name, PTR_ERR(dev));
- return PTR_ERR(dev);
- }
- return 0;
-}
-
-static void ve_unix98_pty_fini(void *data)
-{
- device_destroy_namespace(tty_class, MKDEV(TTYAUX_MAJOR, 2), data);
-}
-
-static struct ve_hook ve_unix98_pty_hook = {
- .init = ve_unix98_pty_init,
- .fini = ve_unix98_pty_fini,
- .priority = HOOK_PRIO_DEFAULT,
- .owner = THIS_MODULE,
-};
-
static struct file_operations ptmx_fops;
static void __init unix98_pty_init(void)
@@ -908,7 +814,6 @@ static void __init unix98_pty_init(void)
register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0)
panic("Couldn't register /dev/ptmx driver");
device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx");
- ve_hook_register(VE_SS_CHAIN, &ve_unix98_pty_hook);
}
#else
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 5c49a67..e4b03bb 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -3100,39 +3100,7 @@ int tty_put_char(struct tty_struct *tty, unsigned char ch)
}
EXPORT_SYMBOL_GPL(tty_put_char);
-static char *tty_devnode(struct device *dev, umode_t *mode);
-
-static struct class tty_class_base = {
- .name = "tty",
- .devnode = tty_devnode,
- .ns_type = &ve_ns_type_operations,
- .namespace = ve_namespace,
- .owner = THIS_MODULE,
-};
-
-struct class *tty_class = &tty_class_base;
-EXPORT_SYMBOL(tty_class);
-
-#ifdef CONFIG_VE
-static inline bool tty_handle_register(struct tty_driver *driver)
-{
- if (!ve_is_super(driver->ve) &&
- (driver->flags & TTY_DRIVER_CONTAINERIZED))
- return false;
- return true;
-}
-#else
-static inline bool tty_handle_register(struct tty_driver *driver)
-{
- return true;
-}
-#endif
-
-static void tty_cdev_del(struct tty_driver *driver, struct cdev *p)
-{
- if (tty_handle_register(driver))
- cdev_del(p);
-}
+struct class *tty_class;
static int tty_cdev_add(struct tty_driver *driver, dev_t dev,
unsigned int index, unsigned int count)
@@ -3140,8 +3108,6 @@ static int tty_cdev_add(struct tty_driver *driver, dev_t dev,
/* init here, since reused cdevs cause crashes */
cdev_init(&driver->cdevs[index], &tty_fops);
driver->cdevs[index].owner = driver->owner;
- if (!tty_handle_register(driver))
- return 0;
return cdev_add(&driver->cdevs[index], dev, count);
}
@@ -3238,8 +3204,7 @@ struct device *tty_register_device_attr(struct tty_driver *driver,
dev->release = tty_device_create_release;
dev_set_name(dev, "%s", name);
dev->groups = attr_grp;
- WARN_ON(drvdata && driver->ve);
- dev_set_drvdata(dev, (drvdata) ? drvdata : driver->ve);
+ dev_set_drvdata(dev, drvdata);
retval = device_register(dev);
if (retval)
@@ -3250,7 +3215,7 @@ struct device *tty_register_device_attr(struct tty_driver *driver,
error:
put_device(dev);
if (cdev)
- tty_cdev_del(driver, &driver->cdevs[index]);
+ cdev_del(&driver->cdevs[index]);
return ERR_PTR(retval);
}
EXPORT_SYMBOL_GPL(tty_register_device_attr);
@@ -3268,17 +3233,10 @@ EXPORT_SYMBOL_GPL(tty_register_device_attr);
void tty_unregister_device(struct tty_driver *driver, unsigned index)
{
-#ifdef CONFIG_VE
- if (driver->flags & TTY_DRIVER_CONTAINERIZED) {
- device_destroy_namespace(tty_class,
- MKDEV(driver->major, driver->minor_start) + index,
- driver->ve);
- } else
-#endif
- device_destroy(tty_class,
+ device_destroy(tty_class,
MKDEV(driver->major, driver->minor_start) + index);
if (!(driver->flags & TTY_DRIVER_DYNAMIC_ALLOC))
- tty_cdev_del(driver, &driver->cdevs[index]);
+ cdev_del(&driver->cdevs[index]);
}
EXPORT_SYMBOL(tty_unregister_device);
@@ -3361,19 +3319,17 @@ static void destruct_tty_driver(struct kref *kref)
* drivers are removed from the kernel.
*/
for (i = 0; i < driver->num; i++) {
- if (!(driver->flags & TTY_DRIVER_DEVPTS_MEM)) {
- tp = driver->termios[i];
- if (tp) {
- driver->termios[i] = NULL;
- kfree(tp);
- }
+ tp = driver->termios[i];
+ if (tp) {
+ driver->termios[i] = NULL;
+ kfree(tp);
}
if (!(driver->flags & TTY_DRIVER_DYNAMIC_DEV))
tty_unregister_device(driver, i);
}
proc_tty_unregister_driver(driver);
if (driver->flags & TTY_DRIVER_DYNAMIC_ALLOC)
- tty_cdev_del(driver, &driver->cdevs[0]);
+ cdev_del(&driver->cdevs[0]);
}
kfree(driver->cdevs);
kfree(driver->ports);
@@ -3411,9 +3367,6 @@ int tty_register_driver(struct tty_driver *driver)
dev_t dev;
struct device *d;
- if (!tty_handle_register(driver))
- goto tty_skip_register;
-
if (!driver->major) {
error = alloc_chrdev_region(&dev, driver->minor_start,
driver->num, driver->name);
@@ -3428,8 +3381,6 @@ int tty_register_driver(struct tty_driver *driver)
if (error < 0)
goto err;
-tty_skip_register:
-
if (driver->flags & TTY_DRIVER_DYNAMIC_ALLOC) {
error = tty_cdev_add(driver, dev, 0, driver->num);
if (error)
@@ -3462,8 +3413,7 @@ err_unreg_devs:
mutex_unlock(&tty_mutex);
err_unreg_char:
- if (tty_handle_register(driver))
- unregister_chrdev_region(dev, driver->num);
+ unregister_chrdev_region(dev, driver->num);
err:
return error;
}
@@ -3479,9 +3429,8 @@ int tty_unregister_driver(struct tty_driver *driver)
if (driver->refcount)
return -EBUSY;
#endif
- if (tty_handle_register(driver))
- unregister_chrdev_region(MKDEV(driver->major, driver->minor_start),
- driver->num);
+ unregister_chrdev_region(MKDEV(driver->major, driver->minor_start),
+ driver->num);
mutex_lock(&tty_mutex);
list_del(&driver->tty_drivers);
mutex_unlock(&tty_mutex);
@@ -3590,7 +3539,11 @@ static char *tty_devnode(struct device *dev, umode_t *mode)
static int __init tty_class_init(void)
{
- return class_register(&tty_class_base);
+ tty_class = class_create(THIS_MODULE, "tty");
+ if (IS_ERR(tty_class))
+ return PTR_ERR(tty_class);
+ tty_class->devnode = tty_devnode;
+ return 0;
}
postcore_initcall(tty_class_init);
@@ -3637,86 +3590,6 @@ static ssize_t show_cons_active(struct device *dev,
}
static DEVICE_ATTR(active, S_IRUGO, show_cons_active, NULL);
-#ifdef CONFIG_VE
-
-void console_sysfs_notify(void)
-{
- struct ve_struct *ve = get_exec_env();
-
- if (ve->consdev)
- sysfs_notify(&ve->consdev->kobj, NULL, "active");
-}
-
-void ve_tty_console_fini(struct ve_struct *ve)
-{
- struct device *consdev = ve->consdev;
- int i;
-
- ve->consdev = NULL;
- device_remove_file(consdev, &dev_attr_active);
- device_destroy_namespace(tty_class, MKDEV(TTYAUX_MAJOR, 1), ve);
- device_destroy_namespace(tty_class, MKDEV(TTYAUX_MAJOR, 0), ve);
-
- if (!ve_is_super(ve)) {
- for (i = 0; i <= MAX_NR_VTTY_CONSOLES; i++) {
- device_destroy_namespace(tty_class,
- MKDEV(TTY_MAJOR, i), ve);
- }
- }
-}
-
-int ve_tty_console_init(struct ve_struct *ve)
-{
- struct device *dev, *d;
- int err, i;
-
- dev = device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 0), ve, "tty");
- if (IS_ERR(dev))
- return PTR_ERR(dev);
- dev = device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), ve,
- "console");
- if (IS_ERR(dev)) {
- err = PTR_ERR(dev);
- goto err_consdev;
- }
-
- err = device_create_file(dev, &dev_attr_active);
- if (err)
- goto err_consfile;
-
- if (!ve_is_super(ve)) {
- for (i = 0; i <= MAX_NR_VTTY_CONSOLES; i++) {
- d = device_create(tty_class, NULL, MKDEV(TTY_MAJOR, i),
- ve, "tty%d", i);
- if (IS_ERR(d)) {
- err = PTR_ERR(dev);
-
- while (i-- > 0)
- device_destroy_namespace(tty_class,
- MKDEV(TTY_MAJOR, i),
- ve);
- device_remove_file(dev, &dev_attr_active);
- goto err_consfile;
- }
- }
- }
-
- ve->consdev = dev;
- return 0;
-
-err_consfile:
- device_destroy_namespace(tty_class, MKDEV(TTYAUX_MAJOR, 1), ve);
-err_consdev:
- device_destroy_namespace(tty_class, MKDEV(TTYAUX_MAJOR, 0), ve);
- return err;
-}
-
-static void tty_init_devices(void)
-{
- if (ve_tty_console_init(get_ve0()))
- WARN_ON(get_ve0()->consdev);
-}
-#else
static struct device *consdev;
void console_sysfs_notify(void)
@@ -3725,18 +3598,6 @@ void console_sysfs_notify(void)
sysfs_notify(&consdev->kobj, NULL, "active");
}
-static void tty_init_devices(void)
-{
- device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 0), NULL, "tty");
- consdev = device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), NULL,
- "console");
- if (IS_ERR(consdev))
- consdev = NULL;
- else
- WARN_ON(device_create_file(consdev, &dev_attr_active) < 0);
-}
-#endif
-
/*
* Ok, now we can initialize the rest of the tty devices and can count
* on memory allocations, interrupts etc..
@@ -3747,12 +3608,19 @@ int __init tty_init(void)
if (cdev_add(&tty_cdev, MKDEV(TTYAUX_MAJOR, 0), 1) ||
register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0)
panic("Couldn't register /dev/tty driver\n");
+ device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 0), NULL, "tty");
cdev_init(&console_cdev, &console_fops);
if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) ||
register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0)
panic("Couldn't register /dev/console driver\n");
- tty_init_devices();
+ consdev = device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), NULL,
+ "console");
+ if (IS_ERR(consdev))
+ consdev = NULL;
+ else
+ WARN_ON(device_create_file(consdev, &dev_attr_active) < 0);
+
#ifdef CONFIG_VT
vty_init(&console_fops);
#endif
diff --git a/fs/sysfs/ve.c b/fs/sysfs/ve.c
index bb28a4b..aa9abf7 100644
--- a/fs/sysfs/ve.c
+++ b/fs/sysfs/ve.c
@@ -33,16 +33,6 @@ const void *ve_netlink_ns(struct sock *sk)
return sock_net(sk)->owner_ve;
}
-const void *ve_namespace(struct device *dev)
-{
- /*
- * Below is a hack. We use drvdata as a ve_struct pointer.
- * But it can be a valid drvdata. We use dev->groups pointer to differ
- * between them: if set, then drvdata is not a ve namespace.
- */
- return (!dev->groups && dev_get_drvdata(dev)) ? dev_get_drvdata(dev) : get_ve0();
-}
-
struct kobj_ns_type_operations ve_ns_type_operations = {
.type = KOBJ_NS_TYPE_VE,
.grab_current_ns = ve_grab_current_ns,
diff --git a/include/linux/device.h b/include/linux/device.h
index 494cf03..bb0ccc1 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1004,7 +1004,6 @@ struct device *device_create_with_groups(struct class *cls,
const struct attribute_group **groups,
const char *fmt, ...);
extern void device_destroy(struct class *cls, dev_t devt);
-extern void device_destroy_namespace(struct class *cls, dev_t devt, void *ns);
/*
* Platform "fixup" functions - allow the platform to have their say
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 5e84d62..d3d9a59 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -704,10 +704,4 @@ static inline void proc_tty_register_driver(struct tty_driver *d) {}
static inline void proc_tty_unregister_driver(struct tty_driver *d) {}
#endif
-#ifdef CONFIG_VE
-struct ve_struct;
-void ve_legacy_pty_fini(struct ve_struct *ve);
-int ve_legacy_pty_init(struct ve_struct *ve);
-#endif
-
#endif
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index 49eaa28..756a609 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -319,9 +319,6 @@ struct tty_driver {
const struct tty_operations *ops;
struct list_head tty_drivers;
-#ifdef CONFIG_VE
- struct ve_struct *ve;
-#endif
};
extern struct list_head tty_drivers;
@@ -412,7 +409,6 @@ static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d)
#define TTY_DRIVER_HARDWARE_BREAK 0x0020
#define TTY_DRIVER_DYNAMIC_ALLOC 0x0040
#define TTY_DRIVER_UNNUMBERED_NODE 0x0080
-#define TTY_DRIVER_CONTAINERIZED 0x0100
/* tty driver types */
#define TTY_DRIVER_TYPE_SYSTEM 0x0001
diff --git a/include/linux/ve.h b/include/linux/ve.h
index d92c0b1..d81fa36 100644
--- a/include/linux/ve.h
+++ b/include/linux/ve.h
@@ -70,14 +70,6 @@ struct ve_struct {
struct binfmt_misc *binfmt_misc;
#endif
-#ifdef CONFIG_LEGACY_PTYS
- struct tty_driver *pty_driver, *pty_slave_driver;
-#endif
-
-#ifdef CONFIG_TTY
- struct device *consdev;
-#endif
-
struct list_head devices;
#if defined(CONFIG_VE_NETDEV) || defined (CONFIG_VE_NETDEV_MODULE)
@@ -166,8 +158,6 @@ extern struct kobj_ns_type_operations ve_ns_type_operations;
extern struct kobject * kobject_create_and_add_ve(const char *name,
struct kobject *parent);
-extern const void *ve_namespace(struct device *dev);
-
extern struct kmapset_set ve_sysfs_perms;
extern int vz_security_family_check(struct net *net, int family);
@@ -282,8 +272,6 @@ static inline struct user_namespace *ve_init_user_ns(void)
#define kobject_create_and_add_ve kobject_create_and_add
-static const void *ve_namespace(struct device *dev) { return NULL; }
-
static inline void monotonic_abs_to_ve(clockid_t which_clock,
struct timespec *tp) { }
static inline void monotonic_ve_to_abs(clockid_t which_clock,
diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index fbb58ff..4d2b3a8 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -24,7 +24,6 @@
#include <linux/sys.h>
#include <linux/kdev_t.h>
#include <linux/termios.h>
-#include <linux/tty_driver.h>
#include <linux/netdevice.h>
#include <linux/utsname.h>
#include <linux/proc_fs.h>
@@ -39,8 +38,6 @@
#include <linux/percpu.h>
#include <linux/fs_struct.h>
#include <linux/task_work.h>
-#include <linux/tty.h>
-#include <linux/console.h>
#include <linux/ctype.h>
#include <uapi/linux/vzcalluser.h>
@@ -477,14 +474,6 @@ int ve_start_container(struct ve_struct *ve)
if (err)
goto err_umh;
- err = ve_legacy_pty_init(ve);
- if (err)
- goto err_legacy_pty;
-
- err = ve_tty_console_init(ve);
- if (err)
- goto err_tty_console;
-
err = ve_hook_iterate_init(VE_SS_CHAIN, ve);
if (err < 0)
goto err_iterate;
@@ -498,10 +487,6 @@ int ve_start_container(struct ve_struct *ve)
return 0;
err_iterate:
- ve_tty_console_fini(ve);
-err_tty_console:
- ve_legacy_pty_fini(ve);
-err_legacy_pty:
ve_stop_umh(ve);
err_umh:
ve_stop_kthread(ve);
@@ -538,9 +523,6 @@ void ve_stop_ns(struct pid_namespace *pid_ns)
*/
ve->is_pseudosuper = 0;
- ve_tty_console_fini(ve);
- ve_legacy_pty_fini(ve);
-
ve_stop_umh(ve);
/*
* Stop kernel thread, or zap_pid_ns_processes() would wait it forever.
More information about the Devel
mailing list