[libvirt] [PATCH] libvirt: lxc: fix incorrect parameter of lxcContainerMountProcFuse

Gao feng gaofeng at cn.fujitsu.com
Wed Jan 9 10:45:48 UTC 2013


On 2013/01/09 18:33, Daniel P. Berrange wrote:
> On Wed, Jan 09, 2013 at 04:05:58PM +0800, Gao feng wrote:
>> when we have no host's src mapped to container's root.
>> there is not .oldroot dir,we should pass "/" to
>> lxcContainerMountProcFuse in function
>> lxcContainerSetupExtraMounts.
>>
>> Signed-off-by: Gao feng <gaofeng at cn.fujitsu.com>
>> ---
>>  src/lxc/lxc_container.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
>> index d234426..09a4365 100644
>> --- a/src/lxc/lxc_container.c
>> +++ b/src/lxc/lxc_container.c
>> @@ -2059,7 +2059,7 @@ static int lxcContainerSetupExtraMounts(virDomainDefPtr vmDef,
>>          goto cleanup;
>>  
>>      /* Mounts /proc/meminfo etc sysinfo */
>> -    if (lxcContainerMountProcFuse(vmDef, "/.oldroot") < 0)
>> +    if (lxcContainerMountProcFuse(vmDef, "/") < 0)
>>          goto cleanup;
>>  
>>      /* Now we can re-mount the cgroups controllers in the
> 
> No, we should be passing NULL in that case, and make the method
> handle NULL correctly.
> 

You mean this?

diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index d234426..9f22923 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 vm
Def,
         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

Thanks!





More information about the libvir-list mailing list