main, vmm: seccomp: Add the '--seccomp log' option

This patch extends the CLI option '--seccomp' to accept the 'log'
parameter in addition 'true/false'. It also refactors the
vmm::seccomp_filters module to support both "SeccompAction::Trap" and
"SeccompAction::Log".

Fixes: #1180

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen
2020-08-03 19:39:07 -07:00
committed by Sebastien Boeuf
parent b41884a406
commit 8e74637ebb
2 changed files with 156 additions and 141 deletions

View File

@@ -260,7 +260,7 @@ fn create_app<'a, 'b>(
Arg::with_name("seccomp")
.long("seccomp")
.takes_value(true)
.possible_values(&["true", "false"])
.possible_values(&["true", "false", "log"])
.default_value("true"),
);
@@ -292,6 +292,7 @@ fn start_vmm(cmd_arguments: ArgMatches) {
match seccomp_value {
"true" => SeccompAction::Trap,
"false" => SeccompAction::Allow,
"log" => SeccompAction::Log,
_ => {
eprintln!("Invalid parameter {} for \"--seccomp\" flag", seccomp_value);
process::exit(1);