libvirt/c2cf5f1c-no-cgroups-fix.patch
James Fehlig 8806eb20b1 - fix leak after listing all volumes - CVE-2013-1962
ca697e90-CVE-2013-1962.patch
  bnc#820397
- Fix iohelper usage with streams opened for read
  a2214c52-iohelper.patch
- Cope with missing swap cgroup controls
  f493d83f-cgroup-swap-control.patch
  bnc#819976
- Fix cgroup handling when setting VCPU BW
  0471637d-cgroups-vcpu-bw.patch
  rhb#963592
- Escape a leading '.' with '_' in the cgroup names
  0ced83dc-cgroup-escape-dot.patch
- Add missing documentation on new cgroup layout
  486a86eb-cgroups-docs.patch
- Another fix related to systems with no cgroups
  c2cf5f1c-no-cgroups-fix.patch
  bnc#819963

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=264
2013-05-18 15:17:46 +00:00

50 lines
1.9 KiB
Diff

commit c2cf5f1c2abc81d607abe34bf5dc4c615a9b8b4d
Author: Daniel P. Berrange <berrange@redhat.com>
Date: Thu May 16 18:47:07 2013 +0100
Fix failure to detect missing cgroup partitions
Change bbe97ae968eba60b71e0066d49f9fc909966d9d6 caused the
QEMU driver to ignore ENOENT errors from cgroups, in order
to cope with missing /proc/cgroups. This is not good though
because many other things can cause ENOENT and should not
be ignored. The callers expect to see ENXIO when cgroups
are not present, so adjust the code to report that errno
when /proc/cgroups is missing
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Index: libvirt-1.0.5/src/qemu/qemu_cgroup.c
===================================================================
--- libvirt-1.0.5.orig/src/qemu/qemu_cgroup.c
+++ libvirt-1.0.5/src/qemu/qemu_cgroup.c
@@ -415,8 +415,7 @@ int qemuInitCgroup(virQEMUDriverPtr driv
if (rc != 0) {
if (rc == -ENXIO ||
rc == -EPERM ||
- rc == -EACCES ||
- rc == -ENOENT) { /* No cgroups mounts == success */
+ rc == -EACCES) { /* No cgroups mounts == success */
VIR_DEBUG("No cgroups present/configured/accessible, ignoring error");
goto done;
}
Index: libvirt-1.0.5/src/util/vircgroup.c
===================================================================
--- libvirt-1.0.5.orig/src/util/vircgroup.c
+++ libvirt-1.0.5/src/util/vircgroup.c
@@ -1110,8 +1110,13 @@ static int virCgroupPartitionNeedsEscapi
path[0] == '.')
return 1;
- if (!(fp = fopen("/proc/cgroups", "r")))
+ if (!(fp = fopen("/proc/cgroups", "r"))) {
+ /* The API contract is that we return ENXIO
+ * if cgroups are not available on a host */
+ if (errno == ENOENT)
+ errno = ENXIO;
return -errno;
+ }
/*
* Data looks like this: