mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices, vmm: Move to the seccompiler crate
Fixes: #2929 Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
@@ -8,7 +8,7 @@ use crate::api::{ApiError, ApiRequest, VmAction};
|
||||
use crate::seccomp_filters::{get_seccomp_filter, Thread};
|
||||
use crate::{Error, Result};
|
||||
use micro_http::{Body, HttpServer, MediaType, Method, Request, Response, StatusCode, Version};
|
||||
use seccomp::{SeccompAction, SeccompFilter};
|
||||
use seccompiler::{apply_filter, SeccompAction};
|
||||
use serde_json::Error as SerdeError;
|
||||
use std::collections::HashMap;
|
||||
use std::fs::File;
|
||||
@@ -276,7 +276,7 @@ fn start_http_thread(
|
||||
.name("http-server".to_string())
|
||||
.spawn(move || {
|
||||
// Apply seccomp filter for API thread.
|
||||
SeccompFilter::apply(api_seccomp_filter).map_err(Error::ApplySeccompFilter)?;
|
||||
apply_filter(&api_seccomp_filter).map_err(Error::ApplySeccompFilter)?;
|
||||
|
||||
server.start_server().unwrap();
|
||||
loop {
|
||||
|
||||
@@ -117,10 +117,10 @@ pub enum ApiError {
|
||||
VmRemoveDevice(VmError),
|
||||
|
||||
/// Cannot create seccomp filter
|
||||
CreateSeccompFilter(seccomp::SeccompError),
|
||||
CreateSeccompFilter(seccompiler::Error),
|
||||
|
||||
/// Cannot apply seccomp filter
|
||||
ApplySeccompFilter(seccomp::Error),
|
||||
ApplySeccompFilter(seccompiler::Error),
|
||||
|
||||
/// The disk could not be added to the VM.
|
||||
VmAddDisk(VmError),
|
||||
|
||||
Reference in New Issue
Block a user