From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T17rp-0001xM-4i for qemu-devel@nongnu.org; Mon, 13 Aug 2012 23:32:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T17rm-0004we-Sa for qemu-devel@nongnu.org; Mon, 13 Aug 2012 23:32:29 -0400 Received: from [201.82.139.216] (port=37979 helo=oc2381481656.ibm.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T17rm-0004wR-J7 for qemu-devel@nongnu.org; Mon, 13 Aug 2012 23:32:26 -0400 From: Eduardo Otubo Date: Mon, 13 Aug 2012 15:44:48 -0300 Message-Id: <1344883488-6680-4-git-send-email-otubo@linux.vnet.ibm.com> In-Reply-To: <1344883488-6680-1-git-send-email-otubo@linux.vnet.ibm.com> References: <1344883488-6680-1-git-send-email-otubo@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v6 3/3] Adding seccomp calls to vl.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Eduardo Otubo v1: * Full seccomp calls and data included in vl.c v2: * Full seccomp calls and data removed from vl.c and put into separate qemu-seccomp.[ch] file. Signed-off-by: Eduardo Otubo --- vl.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/vl.c b/vl.c index 91076f0..2c62efc 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 @@ -2299,6 +2304,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]); -- 1.7.1