]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libvirt: lxc: fix incorrect parameter of lxcContainerMountProcFuse
authorGao feng <gaofeng@cn.fujitsu.com>
Wed, 9 Jan 2013 11:01:11 +0000 (19:01 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 9 Jan 2013 14:08:42 +0000 (15:08 +0100)
when we has no host's src mapped to container.
there is no .oldroot dir,so libvirt lxc will fail
to start when mouting meminfo.

in this case,the parameter srcprefix of function
lxcContainerMountProcFuse should be NULL.and make
this method handle NULL correctly.

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

index d234426ff88d586de6b034aab4ae0f603cb37f83..9f229238a6f6bce181a9f2c8abf51f7baf0b7d12 100644 (file)
@@ -605,7 +605,7 @@ static int lxcContainerMountProcFuse(virDomainDefPtr def,
 
     if ((ret = virAsprintf(&meminfo_path,
                            "%s/%s/%s/meminfo",
-                           srcprefix, LXC_STATE_DIR,
+                           srcprefix ? srcprefix : "", LXC_STATE_DIR,
                            def->name)) < 0)
         return ret;
 
@@ -2059,7 +2059,7 @@ static int lxcContainerSetupExtraMounts(virDomainDefPtr vmDef,
         goto cleanup;
 
     /* Mounts /proc/meminfo etc sysinfo */
-    if (lxcContainerMountProcFuse(vmDef, "/.oldroot") < 0)
+    if (lxcContainerMountProcFuse(vmDef, NULL) < 0)
         goto cleanup;
 
     /* Now we can re-mount the cgroups controllers in the