[PATCH] Remove legacy code for single-instance devpts filesystem

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

An earlier commit dropped support for using LXC with kernels
having single-instance devpts filesystem from the LXC
controller. It forgot to remove the same code from the LXC
container setup.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 src/lxc/lxc_container.c | 25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index c74e3ca..181f6c8 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -869,25 +869,14 @@ static int lxcContainerPopulateDevices(char **ttyPaths, size_t nttyPaths)
         }
     }
 
-    if (access("/dev/pts/ptmx", W_OK) == 0) {
-        /* We have private devpts capability, so bind that */
-        if (virFileTouch("/dev/ptmx", 0666) < 0)
-            return -1;
+    /* We have private devpts capability, so bind that */
+    if (virFileTouch("/dev/ptmx", 0666) < 0)
+        return -1;
 
-        if (mount("/dev/pts/ptmx", "/dev/ptmx", "ptmx", MS_BIND, NULL) < 0) {
-            virReportSystemError(errno, "%s",
-                                 _("Failed to bind /dev/pts/ptmx on to /dev/ptmx"));
-            return -1;
-        }
-    } else {
-        /* Legacy devpts, so we need to just use shared one */
-        dev_t dev = makedev(LXC_DEV_MAJ_TTY, LXC_DEV_MIN_PTMX);
-        if (mknod("/dev/ptmx", S_IFCHR, dev) < 0 ||
-            chmod("/dev/ptmx", 0666)) {
-            virReportSystemError(errno, "%s",
-                                 _("Failed to make device /dev/ptmx"));
-            return -1;
-        }
+    if (mount("/dev/pts/ptmx", "/dev/ptmx", "ptmx", MS_BIND, NULL) < 0) {
+        virReportSystemError(errno, "%s",
+                             _("Failed to bind /dev/pts/ptmx on to /dev/ptmx"));
+        return -1;
     }
 
     for (i = 0; i < nttyPaths; i++) {
-- 
1.8.1.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]