]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Remove support for old kernels lacking private devpts
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 28 Mar 2013 17:30:25 +0000 (17:30 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 4 Apr 2013 09:51:59 +0000 (10:51 +0100)
Early on kernel support for private devpts was not widespread,
so we had compatibiltiy codepaths. Such old kernels are not
seriously used for LXC these days, so the compat code can go
away

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/lxc/lxc_controller.c

index 1d1443c9f577b83b24ad3b96da8e71690c28f733..cede4455bb01145f6bf78e7a531c664382f1e076 100644 (file)
@@ -1252,8 +1252,9 @@ virLXCControllerSetupDevPTS(virLXCControllerPtr ctrl)
     }
 
     if (access(ctrl->devptmx, R_OK) < 0) {
-        VIR_WARN("Kernel does not support private devpts, using shared devpts");
-        VIR_FREE(ctrl->devptmx);
+        virReportSystemError(ENOSYS, "%s",
+                             _("Kernel does not support private devpts"));
+        goto cleanup;
     }
 
     ret = 0;
@@ -1278,24 +1279,13 @@ virLXCControllerSetupConsoles(virLXCControllerPtr ctrl,
     size_t i;
 
     for (i = 0 ; i < ctrl->nconsoles ; i++) {
-        if (ctrl->devptmx) {
-            VIR_DEBUG("Opening tty on private %s", ctrl->devptmx);
-            if (lxcCreateTty(ctrl->devptmx,
-                             &ctrl->consoles[i].contFd,
-                             &containerTTYPaths[i]) < 0) {
-                virReportSystemError(errno, "%s",
-                                     _("Failed to allocate tty"));
-                return -1;
-            }
-        } else {
-            VIR_DEBUG("Opening tty on shared /dev/ptmx");
-            if (virFileOpenTty(&ctrl->consoles[i].contFd,
-                               &containerTTYPaths[i],
-                               0) < 0) {
-                virReportSystemError(errno, "%s",
+        VIR_DEBUG("Opening tty on private %s", ctrl->devptmx);
+        if (lxcCreateTty(ctrl->devptmx,
+                         &ctrl->consoles[i].contFd,
+                         &containerTTYPaths[i]) < 0) {
+            virReportSystemError(errno, "%s",
                                      _("Failed to allocate tty"));
-                return -1;
-            }
+            return -1;
         }
     }
     return 0;