mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user