diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index aaf94cfd98a00bd3fd8d40c97420bfa76dc1a976..9784f3111a385218537adb183a8a63a646adbace 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -456,8 +456,7 @@ int qemuInitCgroup(virQEMUDriverPtr driver, 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; } diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 5780785c5472f1e47541019e4e44a5c97b5028ac..07ea2c30ef03a4e69e4c528148a97433515dd7d8 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -1110,8 +1110,13 @@ static int virCgroupPartitionNeedsEscaping(const char *path) 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: