From f2c813e1cfecac602f0138acffc147ba483aa880 Mon Sep 17 00:00:00 2001 From: Omer Faruk Bayram Date: Sat, 20 May 2023 12:37:44 +0300 Subject: [PATCH] vmm: seccomp: rename `Thread::Api` to `Thread::HttpApi` Signed-off-by: Omer Faruk Bayram --- vmm/src/api/http/mod.rs | 2 +- vmm/src/seccomp_filters.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vmm/src/api/http/mod.rs b/vmm/src/api/http/mod.rs index 12ddad93a..2f4b0283c 100644 --- a/vmm/src/api/http/mod.rs +++ b/vmm/src/api/http/mod.rs @@ -284,7 +284,7 @@ fn start_http_thread( hypervisor_type: HypervisorType, ) -> Result>> { // Retrieve seccomp filter for API thread - let api_seccomp_filter = get_seccomp_filter(seccomp_action, Thread::Api, hypervisor_type) + let api_seccomp_filter = get_seccomp_filter(seccomp_action, Thread::HttpApi, hypervisor_type) .map_err(VmmError::CreateSeccompFilter)?; thread::Builder::new() diff --git a/vmm/src/seccomp_filters.rs b/vmm/src/seccomp_filters.rs index 9c11b8754..5d804fc2e 100644 --- a/vmm/src/seccomp_filters.rs +++ b/vmm/src/seccomp_filters.rs @@ -12,7 +12,7 @@ use seccompiler::{ use std::convert::TryInto; pub enum Thread { - Api, + HttpApi, SignalHandler, Vcpu, Vmm, @@ -743,9 +743,9 @@ fn vcpu_thread_rules( ]) } -// The filter containing the white listed syscall rules required by the API to +// The filter containing the white listed syscall rules required by the HTTP API to // function. -fn api_thread_rules() -> Result)>, BackendError> { +fn http_api_thread_rules() -> Result)>, BackendError> { Ok(vec![ (libc::SYS_accept4, vec![]), (libc::SYS_brk, vec![]), @@ -777,7 +777,7 @@ fn get_seccomp_rules( hypervisor_type: HypervisorType, ) -> Result)>, BackendError> { match thread_type { - Thread::Api => Ok(api_thread_rules()?), + Thread::HttpApi => Ok(http_api_thread_rules()?), Thread::SignalHandler => Ok(signal_handler_thread_rules()?), Thread::Vcpu => Ok(vcpu_thread_rules(hypervisor_type)?), Thread::Vmm => Ok(vmm_thread_rules(hypervisor_type)?),