diff --git a/meson.build b/meson.build index 790d52ec8d..e48e63ef01 100644 --- a/meson.build +++ b/meson.build @@ -644,13 +644,6 @@ symbols = [ [ 'sched.h', 'cpu_set_t' ], ] -if host_machine.system() == 'linux' - symbols += [ - # Check if we have new enough kernel to support BPF devices for cgroups v2 - [ 'linux/bpf.h', 'BPF_CGROUP_DEVICE' ], - ] -endif - foreach symbol : symbols if cc.has_header_symbol(symbol[0], symbol[1], args: '-D_GNU_SOURCE', prefix: symbol.get(2, '')) conf.set('WITH_DECL_@0@'.format(symbol[1].to_upper()), 1) diff --git a/src/util/vircgroupv2devices.c b/src/util/vircgroupv2devices.c index 1769c499c8..05818c4130 100644 --- a/src/util/vircgroupv2devices.c +++ b/src/util/vircgroupv2devices.c @@ -17,13 +17,13 @@ */ #include -#if WITH_DECL_BPF_CGROUP_DEVICE +#if __linux__ # include # include # include # include # include -#endif /* !WITH_DECL_BPF_CGROUP_DEVICE */ +#endif /* __linux__ */ #include "internal.h" @@ -41,7 +41,7 @@ VIR_LOG_INIT("util.cgroup"); #define VIR_FROM_THIS VIR_FROM_CGROUP -#if WITH_DECL_BPF_CGROUP_DEVICE +#ifdef __linux__ bool virCgroupV2DevicesAvailable(virCgroup *group) { @@ -583,7 +583,7 @@ virCgroupV2DevicesGetPerms(int perms, return ret; } -#else /* !WITH_DECL_BPF_CGROUP_DEVICE */ +#else /* !__linux__ */ bool virCgroupV2DevicesAvailable(virCgroup *group G_GNUC_UNUSED) { @@ -634,7 +634,7 @@ virCgroupV2DevicesGetPerms(int perms G_GNUC_UNUSED, { return 0; } -#endif /* !WITH_DECL_BPF_CGROUP_DEVICE */ +#endif /* !__linux__ */ uint64_t