[Pkg-libvirt-maintainers] Bug#566180: Bug#566180: virsh can define	lxc domain but does not list nor properly start it
    Guido Günther 
    agx at sigxcpu.org
       
    Thu Oct 14 20:58:23 UTC 2010
    
    
  
On Thu, Oct 14, 2010 at 10:02:30PM +0200, Guido Günther wrote:
> On Thu, Oct 14, 2010 at 07:32:58PM +0200, Guido Günther wrote:
> > > 12:33:06.252: error : lxcSetContainerResources:109 : Unable to set memory
> > > limit for domain vm0: No such file or directory
> Nevermind. I can reproduce this now.
The file missing is memory.limit_in_bytes which needs
CONFIG_RESOURCE_COUNTERS=y
CONFIG_CGROUP_MEM_RES_CTLR=y
wich we don't have in Squeeze. This fixes it by ignoring errors due to
memory limit setting:
--- libvirt-0.8.3.orig/src/util/cgroup.c
+++ libvirt-0.8.3/src/util/cgroup.c
@@ -870,6 +870,8 @@ int virCgroupGetMemoryUsage(virCgroupPtr
                                "memory.usage_in_bytes", &usage_in_bytes);
     if (ret == 0)
         *kb = (unsigned long) usage_in_bytes >> 10;
+    else
+        *kb = 0;
     return ret;
 }
 
--- libvirt-0.8.3.orig/src/lxc/lxc_driver.c
+++ libvirt-0.8.3/src/lxc/lxc_driver.c
@@ -516,7 +516,6 @@ static int lxcDomainGetInfo(virDomainPtr
         if (virCgroupGetMemoryUsage(cgroup, &(info->memory)) < 0) {
             lxcError(VIR_ERR_OPERATION_FAILED,
                      "%s", _("Cannot read memory usage for domain"));
-            goto cleanup;
         }
     }
 
--- libvirt-0.8.3.orig/src/lxc/lxc_controller.c
+++ libvirt-0.8.3/src/lxc/lxc_controller.c
@@ -107,7 +107,6 @@ static int lxcSetContainerResources(virD
         virReportSystemError(-rc,
                              _("Unable to set memory limit for domain %s"),
                              def->name);
-        goto cleanup;
     }
 
     rc = virCgroupDenyAllDevices(cgroup);
Works here now.
 -- Guido
    
    
More information about the Pkg-libvirt-maintainers
mailing list