virReportSystemError(-rc,
_("Unable to set memory limit for domain %s"),
def->name);
- goto cleanup;
+ /* Don't fail if we can't set memory due to lack of kernel support */
+ if (rc != -ENOENT)
+ goto cleanup;
}
if(def->mem.hard_limit) {
lxc_driver_t *driver = dom->conn->privateData;
virDomainObjPtr vm;
virCgroupPtr cgroup = NULL;
- int ret = -1;
+ int ret = -1, rc;
lxcDriverLock(driver);
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
"%s", _("Cannot read cputime for domain"));
goto cleanup;
}
- if (virCgroupGetMemoryUsage(cgroup, &(info->memory)) < 0) {
+ if ((rc = virCgroupGetMemoryUsage(cgroup, &(info->memory))) < 0) {
lxcError(VIR_ERR_OPERATION_FAILED,
"%s", _("Cannot read memory usage for domain"));
- goto cleanup;
+ if (rc == -ENOENT) {
+ /* Don't fail if we can't read memory usage due to a lack of
+ * kernel support */
+ info->memory = 0;
+ } else
+ goto cleanup;
}
}