提交 94a24dd3 编写于 作者: M Michal Privoznik

qemuSetupMemoryCgroup: Handle hard_limit properly

Since 16bcb3 we have a regression. The hard_limit is set
unconditionally. By default the limit is zero. Hence, if user hasn't
configured any, we set the zero in cgroup subsystem making the kernel
kill the corresponding qemu process immediately. The proper fix is to
set hard_limit iff user has configured any.
上级 8563b091
......@@ -428,7 +428,8 @@ qemuSetupMemoryCgroup(virDomainObjPtr vm)
}
}
if (virCgroupSetMemoryHardLimit(priv->cgroup, vm->def->mem.hard_limit) < 0)
if (vm->def->mem.hard_limit != 0 &&
virCgroupSetMemoryHardLimit(priv->cgroup, vm->def->mem.hard_limit) < 0)
return -1;
if (vm->def->mem.soft_limit != 0 &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册