]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: remove obsolete check for BPF_CGROUP_DEVICE
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 8 Dec 2022 09:45:20 +0000 (09:45 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 12 Dec 2022 10:36:58 +0000 (10:36 +0000)
The BPF_CGROUP_DEVICE constant was introduced to Linux in

  commit ebc614f687369f9df99828572b1d85a7c2de3d92
  Author: Roman Gushchin <roman.gushchin@linux.dev>
  Date:   Sun Nov 5 08:15:32 2017 -0500

    bpf, cgroup: implement eBPF-based device controller for cgroup v2

This is old enough that all our supported platforms can be assumed
to have this feature.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
meson.build
src/util/vircgroupv2devices.c

index 790d52ec8d44ca85bd62835698e4b15c58667911..e48e63ef0171859319ab3aee69d292deb4def382 100644 (file)
@@ -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)
index 1769c499c8bf7867eb936d85560d4a4cabead010..05818c4130e1814fc055877e33b7fe939f2ce91e 100644 (file)
  */
 #include <config.h>
 
-#if WITH_DECL_BPF_CGROUP_DEVICE
+#if __linux__
 # include <fcntl.h>
 # include <linux/bpf.h>
 # include <sys/stat.h>
 # include <sys/syscall.h>
 # include <sys/types.h>
-#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