提交 f493d83f 编写于 作者: D Daniel P. Berrange

Cope with missing swap cgroup controls

It is possible to build a kernel without swap cgroup controls
present. This causes a fatal error when querying memory
parameters. Treat missing swap controls as meaning "unlimited".
The fatal error remains if the user tries to actually change
the limit.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 95934171
...@@ -7613,9 +7613,12 @@ qemuDomainGetMemoryParameters(virDomainPtr dom, ...@@ -7613,9 +7613,12 @@ qemuDomainGetMemoryParameters(virDomainPtr dom,
case 2: /* fill swap hard limit here */ case 2: /* fill swap hard limit here */
rc = virCgroupGetMemSwapHardLimit(priv->cgroup, &val); rc = virCgroupGetMemSwapHardLimit(priv->cgroup, &val);
if (rc != 0) { if (rc != 0) {
virReportSystemError(-rc, "%s", if (rc != -ENOENT) {
_("unable to get swap hard limit")); virReportSystemError(-rc, "%s",
goto cleanup; _("unable to get swap hard limit"));
goto cleanup;
}
val = VIR_DOMAIN_MEMORY_PARAM_UNLIMITED;
} }
if (virTypedParameterAssign(param, if (virTypedParameterAssign(param,
VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT, VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册