Skip to contentSkip to conversation

seccomp: Don't include libseccomp from QEMU header

PATCH In review Fam Zheng 4 participants 4 messages Sep 20, 2017 – Sep 22, 2017

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 seccomp: Don't include libseccomp from QEMU header

The only prototype doesn't need anything from the lib header, and not including it here allows files that include this header, for example vl.c, to compile without the libseccomp cflags.

The breakage is since c3883e1f93 for environments where `pkg-config --cflags libseccomp" is non-empty.

---

This is an alternative for

https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg04470.html
([Qemu-devel] [PATCH] seccomp: Fix build)

---
 include/sysemu/seccomp.h | 2 --
 1 file changed, 2 deletions(-)
include/sysemu/seccomp.h +0 -2
index e67c2dc840..9b092aa23f 100644
@@ -21,7 +21,5 @@
 #define QEMU_SECCOMP_SET_SPAWN       (1 << 3)
 #define QEMU_SECCOMP_SET_RESOURCECTL (1 << 4)
 
-#include <seccomp.h>
-
 int seccomp_start(uint32_t seccomp_opts);
 #endif
Signature · 1 line
2.13.5
#1 lore raw
Quoted 26 lines · Fam Zheng

The only prototype doesn't need anything from the lib header, and not including it here allows files that include this header, for example vl.c, to compile without the libseccomp cflags.

The breakage is since c3883e1f93 for environments where `pkg-config --cflags libseccomp" is non-empty.

---

This is an alternative for

https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg04470.html
([Qemu-devel] [PATCH] seccomp: Fix build)

---
 include/sysemu/seccomp.h | 2 --
 1 file changed, 2 deletions(-)
include/sysemu/seccomp.h +0 -0
index e67c2dc840..9b092aa23f 100644

include/sysemu/seccomp.h line 25

Quoted 7 lines
include/sysemu/seccomp.h +0 -2
@@ -21,7 +21,5 @@
 #define QEMU_SECCOMP_SET_SPAWN       (1 << 3)
 #define QEMU_SECCOMP_SET_RESOURCECTL (1 << 4)
 
-#include <seccomp.h>
-
 int seccomp_start(uint32_t seccomp_opts);
 #endif

Works fine for me as well and is indeed cleaner.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux
Acked-by
#2 lore raw
Quoted 10 lines · Jan Kiszka
Quoted 9 lines · Fam Zheng

The only prototype doesn't need anything from the lib header, and not including it here allows files that include this header, for example vl.c, to compile without the libseccomp cflags.

The breakage is since c3883e1f93 for environments where `pkg-config --cflags libseccomp" is non-empty.

Quoted 32 lines
Quoted 17 lines

---

This is an alternative for

https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg04470.html
([Qemu-devel] [PATCH] seccomp: Fix build)

---
 include/sysemu/seccomp.h | 2 --
 1 file changed, 2 deletions(-)
include/sysemu/seccomp.h +0 -0
index e67c2dc840..9b092aa23f 100644

include/sysemu/seccomp.h line 25

Quoted 7 lines
include/sysemu/seccomp.h +0 -2
@@ -21,7 +21,5 @@
 #define QEMU_SECCOMP_SET_SPAWN       (1 << 3)
 #define QEMU_SECCOMP_SET_RESOURCECTL (1 << 4)
 
-#include <seccomp.h>
-
 int seccomp_start(uint32_t seccomp_opts);
 #endif

Works fine for me as well and is indeed cleaner.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux
Signature · 2 lines
Eduardo Otubo
Senior Software Engineer @ RedHat
#3 lore raw
Quoted 6 lines · Eduardo Otubo
Quoted 5 lines · Jan Kiszka
Quoted 4 lines · Fam Zheng

The only prototype doesn't need anything from the lib header, and not including it here allows files that include this header, for example vl.c, to compile without the libseccomp cflags.

Quoted 8 lines
Quoted 5 lines
Quoted 5 lines

The breakage is since c3883e1f93 for environments where `pkg-config --cflags libseccomp" is non-empty.

Thanks. Applied to master as a buildfix.

-- PMM