From ae9874e471fc61d9d654247c2fd24d9baa455afa Mon Sep 17 00:00:00 2001 From: Gao feng Date: Wed, 9 Jan 2013 19:01:11 +0800 Subject: [PATCH] libvirt: lxc: fix incorrect parameter of lxcContainerMountProcFuse 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 --- src/lxc/lxc_container.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index d234426ff8..9f229238a6 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -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 -- GitLab