2013-05-18 17:17:46 +02:00
|
|
|
commit f493d83fbd3257453e63f2f32ee90a216fd531c1
|
|
|
|
Author: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
Date: Thu May 9 13:53:39 2013 +0100
|
|
|
|
|
|
|
|
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: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
|
2013-05-21 20:02:56 +02:00
|
|
|
Index: libvirt-1.0.5.1/src/qemu/qemu_driver.c
|
2013-05-18 17:17:46 +02:00
|
|
|
===================================================================
|
2013-05-21 20:02:56 +02:00
|
|
|
--- libvirt-1.0.5.1.orig/src/qemu/qemu_driver.c
|
|
|
|
+++ libvirt-1.0.5.1/src/qemu/qemu_driver.c
|
|
|
|
@@ -7352,9 +7352,12 @@ qemuDomainGetMemoryParameters(virDomainP
|
2013-05-18 17:17:46 +02:00
|
|
|
case 2: /* fill swap hard limit here */
|
|
|
|
rc = virCgroupGetMemSwapHardLimit(priv->cgroup, &val);
|
|
|
|
if (rc != 0) {
|
|
|
|
- virReportSystemError(-rc, "%s",
|
|
|
|
- _("unable to get swap hard limit"));
|
|
|
|
- goto cleanup;
|
|
|
|
+ if (rc != -ENOENT) {
|
|
|
|
+ virReportSystemError(-rc, "%s",
|
|
|
|
+ _("unable to get swap hard limit"));
|
|
|
|
+ goto cleanup;
|
|
|
|
+ }
|
|
|
|
+ val = VIR_DOMAIN_MEMORY_PARAM_UNLIMITED;
|
|
|
|
}
|
|
|
|
if (virTypedParameterAssign(param,
|
|
|
|
VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT,
|