diff --git a/vl.c b/vl.c index d01256a6a3..1010248dcd 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]);