[Qemu-devel] [PATCH] seccomp: Don't include libseccomp from QEMU header

Fam Zheng posted 1 patch 6 years, 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170920083647.14599-1-famz@redhat.com
Test checkpatch passed
Test docker passed
Test s390x passed
include/sysemu/seccomp.h | 2 --
1 file changed, 2 deletions(-)
[Qemu-devel] [PATCH] seccomp: Don't include libseccomp from QEMU header
Posted by Fam Zheng 6 years, 7 months ago
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.

Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Fam Zheng <famz@redhat.com>

---

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(-)

diff --git a/include/sysemu/seccomp.h b/include/sysemu/seccomp.h
index e67c2dc840..9b092aa23f 100644
--- a/include/sysemu/seccomp.h
+++ b/include/sysemu/seccomp.h
@@ -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
-- 
2.13.5


Re: [Qemu-devel] [PATCH] seccomp: Don't include libseccomp from QEMU header
Posted by Jan Kiszka 6 years, 7 months ago
On 2017-09-20 10:36, Fam Zheng wrote:
> 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.
> 
> Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
> Signed-off-by: Fam Zheng <famz@redhat.com>
> 
> ---
> 
> 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(-)
> 
> diff --git a/include/sysemu/seccomp.h b/include/sysemu/seccomp.h
> index e67c2dc840..9b092aa23f 100644
> --- a/include/sysemu/seccomp.h
> +++ b/include/sysemu/seccomp.h
> @@ -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

-- 
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux

Re: [Qemu-devel] [PATCH] seccomp: Don't include libseccomp from QEMU header
Posted by Eduardo Otubo 6 years, 7 months ago
On Fri, Sep 22, 2017 at 09:09:27AM +0200, Jan Kiszka wrote:
> On 2017-09-20 10:36, Fam Zheng wrote:
> > 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.
> > 
> > Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
> > Signed-off-by: Fam Zheng <famz@redhat.com>

Acked-by: Eduardo Otubo <otubo@redhat.com>

> > 
> > ---
> > 
> > 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(-)
> > 
> > diff --git a/include/sysemu/seccomp.h b/include/sysemu/seccomp.h
> > index e67c2dc840..9b092aa23f 100644
> > --- a/include/sysemu/seccomp.h
> > +++ b/include/sysemu/seccomp.h
> > @@ -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
> 
> -- 
> Siemens AG, Corporate Technology, CT RDA ITP SES-DE
> Corporate Competence Center Embedded Linux

-- 
Eduardo Otubo
Senior Software Engineer @ RedHat

Re: [Qemu-devel] [PATCH] seccomp: Don't include libseccomp from QEMU header
Posted by Peter Maydell 6 years, 7 months ago
On 22 September 2017 at 08:54, Eduardo Otubo <otubo@redhat.com> wrote:
> On Fri, Sep 22, 2017 at 09:09:27AM +0200, Jan Kiszka wrote:
>> On 2017-09-20 10:36, Fam Zheng wrote:
>> > 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.
>> >
>> > Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
>> > Signed-off-by: Fam Zheng <famz@redhat.com>
>
> Acked-by: Eduardo Otubo <otubo@redhat.com>
>

Thanks. Applied to master as a buildfix.

-- PMM