]> xenbits.xensource.com Git - libvirt.git/commitdiff
Set default partition in libvirtd instead of libvirt_lxc
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 26 Jul 2013 14:59:16 +0000 (15:59 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 26 Jul 2013 16:46:22 +0000 (17:46 +0100)
By setting the default partition in libvirt_lxc it is not
visible when querying the live XML. Move setting of the
default partition into libvirtd virLXCProcessStart

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

index af91b049aff91533bd8724e03193a2f2c6828030..0b0ca02606aea845b243c443a55fa2900b7c2924 100644 (file)
@@ -433,20 +433,6 @@ virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def)
 {
     virCgroupPtr cgroup = NULL;
 
-    if (!def->resource) {
-        virDomainResourceDefPtr res;
-
-        if (VIR_ALLOC(res) < 0)
-            goto cleanup;
-
-        if (VIR_STRDUP(res->partition, "/machine") < 0) {
-            VIR_FREE(res);
-            goto cleanup;
-        }
-
-        def->resource = res;
-    }
-
     if (def->resource->partition[0] != '/') {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        _("Resource partition '%s' must start with '/'"),
index 1a5686f36760d4a20253d97f5827d8c9d236ca98..247e516cb139697d66f82053c693c7a5220dc982 100644 (file)
@@ -1007,6 +1007,20 @@ int virLXCProcessStart(virConnectPtr conn,
         return -1;
     }
 
+    if (!vm->def->resource) {
+        virDomainResourceDefPtr res;
+
+        if (VIR_ALLOC(res) < 0)
+            goto cleanup;
+
+        if (VIR_STRDUP(res->partition, "/machine") < 0) {
+            VIR_FREE(res);
+            goto cleanup;
+        }
+
+        vm->def->resource = res;
+    }
+
     if (virAsprintf(&logfile, "%s/%s.log",
                     cfg->logDir, vm->def->name) < 0)
         return -1;