diff --git a/src/util/vircgroupv1.c b/src/util/vircgroupv1.c index 62a6e5c448ee0c670825891d41e342efcf222ecb..28a74474ee8259129c524cd1aa1802e3c095eb7b 100644 --- a/src/util/vircgroupv1.c +++ b/src/util/vircgroupv1.c @@ -20,13 +20,11 @@ */ #include -#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R +#ifdef __linux__ # include -#endif -#include -#if defined HAVE_SYS_MOUNT_H +# include # include -#endif +#endif /* __linux__ */ #include "internal.h" @@ -55,6 +53,8 @@ VIR_ENUM_IMPL(virCgroupV1Controller, VIR_CGROUP_CONTROLLER_LAST, "name=systemd"); +#ifdef __linux__ + /* We're looking for at least one 'cgroup' fs mount, * which is *not* a named mount. */ static bool @@ -2099,3 +2099,13 @@ virCgroupV1Register(void) { virCgroupBackendRegister(&virCgroupV1Backend); } + +#else /* !__linux__ */ + +void +virCgroupV1Register(void) +{ + VIR_INFO("Control groups not supported on this platform"); +} + +#endif /* !__linux__ */