]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: remove obsolete check for BPF_PROG_QUERY
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:18 +0000 (10:36 +0000)
The BPF_PROG_QUERY constant was introduced to Linux in

  commit defd9c476fa6b01b4eb5450452bfd202138decb7
  Author: Alexei Starovoitov <ast@kernel.org>
  Date:   Mon Oct 2 22:50:26 2017 -0700

    libbpf: sync bpf.h

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/virbpf.c
src/util/virbpf.h

index 95bc89ec523e4f1ac47da5aed9864e427d435bc7..790d52ec8d44ca85bd62835698e4b15c58667911 100644 (file)
@@ -647,7 +647,6 @@ symbols = [
 if host_machine.system() == 'linux'
   symbols += [
     # Check if we have new enough kernel to support BPF devices for cgroups v2
-    [ 'linux/bpf.h', 'BPF_PROG_QUERY' ],
     [ 'linux/bpf.h', 'BPF_CGROUP_DEVICE' ],
   ]
 endif
index 1169b99d07675580055b6514670fb9eee508f8e0..34abf6f9b4cb7627ea200bc27c7664139f7edc2d 100644 (file)
@@ -24,7 +24,7 @@ VIR_LOG_INIT("util.bpf");
 
 #define VIR_FROM_THIS VIR_FROM_BPF
 
-#if WITH_SYS_SYSCALL_H && WITH_DECL_BPF_PROG_QUERY
+#ifdef __linux__
 # include <sys/syscall.h>
 # include <unistd.h>
 
@@ -292,7 +292,7 @@ virBPFDeleteElem(int mapfd,
 }
 
 
-#else /* !WITH_SYS_SYSCALL_H || !WITH_DECL_BPF_PROG_QUERY */
+#else /* ! __linux__ */
 
 
 int
@@ -420,4 +420,4 @@ virBPFDeleteElem(int mapfd G_GNUC_UNUSED,
     errno = ENOSYS;
     return -1;
 }
-#endif /* !WITH_SYS_SYSCALL_H || !WITH_DECL_BPF_PROG_QUERY */
+#endif /* !__linux__ */
index 1eafce86c0dd41bf2b56c9437a2ff5670bf9d36f..cf21ac2d407a14eefd1f9ceead9c3dc81b5a493f 100644 (file)
@@ -18,7 +18,7 @@
 
 #pragma once
 
-#if WITH_DECL_BPF_PROG_QUERY
+#ifdef __linux__
 
 # include <linux/bpf.h>
 
      .imm = 0, \
      })
 
-#else /* WITH_DECL_BPF_PROG_QUERY */
+#else /* ! __linux__ */
 
 struct bpf_prog_info;
 struct bpf_map_info;
@@ -191,7 +191,7 @@ struct bpf_insn;
 # define VIR_BPF_CALL_INSN(func)
 # define VIR_BPF_EXIT_INSN()
 
-#endif /* WITH_DECL_BPF_PROG_QUERY */
+#endif /* ! __linux__ */
 
 int
 virBPFCreateMap(unsigned int mapType,