From: Eduardo Otubo Date: Tue, 14 Aug 2012 21:44:07 +0000 (-0300) Subject: Adding seccomp calls to vl.c (v8) X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~3730 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=452dfbef600837c0e430564ea9e35138ef48f24c;p=sdk%2Femulator%2Fqemu.git Adding seccomp calls to vl.c (v8) Signed-off-by: Eduardo Otubo Signed-off-by: Anthony Liguori --- v1: - Full seccomp calls and data included in vl.c v1 -> v2: - Full seccomp calls and data removed from vl.c and put into separate qemu-seccomp.[ch] file. --- diff --git a/vl.c b/vl.c index d01256a..1010248 100644 --- a/vl.c +++ b/vl.c @@ -63,6 +63,11 @@ #include #include #endif + +#ifdef CONFIG_SECCOMP +#include "qemu-seccomp.h" +#endif + #ifdef __sun__ #include #include @@ -2344,6 +2349,14 @@ int main(int argc, char **argv, char **envp) const char *trace_events = NULL; const char *trace_file = NULL; +#ifdef CONFIG_SECCOMP + if (seccomp_start() < 0) { + fprintf(stderr, + "seccomp: failed to install syscall filter in the kernel\n"); + exit(1); + } +#endif + atexit(qemu_run_exit_notifiers); error_set_progname(argv[0]);