]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
LXC: remove unnecessary check on root filesystem
authorGao feng <gaofeng@cn.fujitsu.com>
Mon, 20 May 2013 10:12:17 +0000 (18:12 +0800)
committerEric Blake <eblake@redhat.com>
Mon, 20 May 2013 18:45:01 +0000 (12:45 -0600)
After commit c131525bec5af248e3843224bc5ce8d6435760f0
"Auto-add a root <filesystem> element to LXC containers on startup"
for libvirt lxc, root must be existent.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
src/lxc/lxc_container.c
src/lxc/lxc_controller.c

index a1b6aff93236b7c0fae7d3f2db1fbcf24d7ed8a4..b4be4cd19d272bff67e90c4bebf7c284ae955651 100644 (file)
@@ -1940,17 +1940,13 @@ static int lxcContainerChild(void *data)
     root = virDomainGetRootFilesystem(vmDef);
 
     if (argv->nttyPaths) {
-        if (root) {
-            const char *tty = argv->ttyPaths[0];
-            if (STRPREFIX(tty, "/dev/pts/"))
-                tty += strlen("/dev/pts/");
-            if (virAsprintf(&ttyPath, "%s/%s.devpts/%s",
-                            LXC_STATE_DIR, vmDef->name, tty) < 0) {
-                virReportOOMError();
-                goto cleanup;
-            }
-        } else if (VIR_STRDUP(ttyPath, argv->ttyPaths[0]) < 0) {
-                goto cleanup;
+        const char *tty = argv->ttyPaths[0];
+        if (STRPREFIX(tty, "/dev/pts/"))
+            tty += strlen("/dev/pts/");
+        if (virAsprintf(&ttyPath, "%s/%s.devpts/%s",
+                        LXC_STATE_DIR, vmDef->name, tty) < 0) {
+            virReportOOMError();
+            goto cleanup;
         }
     } else if (VIR_STRDUP(ttyPath, "/dev/null") < 0) {
             goto cleanup;
index 730236ef16fbb074c999f083d566acb2ed4a18cd..2f01958f815dbd792d3f24c235adf8d54f3b5153 100644 (file)
@@ -1280,22 +1280,11 @@ cleanup:
 static int
 virLXCControllerSetupDevPTS(virLXCControllerPtr ctrl)
 {
-    virDomainFSDefPtr root = virDomainGetRootFilesystem(ctrl->def);
     char *mount_options = NULL;
     char *opts = NULL;
     char *devpts = NULL;
     int ret = -1;
 
-    if (!root) {
-        if (ctrl->nconsoles != 1) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                           _("Expected exactly one console, but got %zu"),
-                           ctrl->nconsoles);
-            return -1;
-        }
-        return 0;
-    }
-
     VIR_DEBUG("Setting up private /dev/pts");
 
     /*