(
path: &str,
api_notifier: EventFd,
api_sender: Sender<ApiRequest>,
seccomp_action: &SeccompAction,
exit_evt: EventFd,
hypervisor_type: HypervisorType,
landlock_enable: bo
| 405 | } |
| 406 | |
| 407 | pub fn start_http_path_thread( |
| 408 | path: &str, |
| 409 | api_notifier: EventFd, |
| 410 | api_sender: Sender<ApiRequest>, |
| 411 | seccomp_action: &SeccompAction, |
| 412 | exit_evt: EventFd, |
| 413 | hypervisor_type: HypervisorType, |
| 414 | landlock_enable: bool, |
| 415 | ) -> Result<HttpApiHandle> { |
| 416 | let socket_path = PathBuf::from(path); |
| 417 | let socket_fd = UnixListener::bind(socket_path).map_err(VmmError::CreateApiServerSocket)?; |
| 418 | // SAFETY: Valid FD just opened |
| 419 | let server = unsafe { HttpServer::new_from_fd(socket_fd.into_raw_fd()) } |
| 420 | .map_err(VmmError::CreateApiServer)?; |
| 421 | |
| 422 | start_http_thread( |
| 423 | server, |
| 424 | api_notifier, |
| 425 | api_sender, |
| 426 | seccomp_action, |
| 427 | exit_evt, |
| 428 | hypervisor_type, |
| 429 | landlock_enable, |
| 430 | ) |
| 431 | } |
| 432 | |
| 433 | pub fn start_http_fd_thread( |
| 434 | fd: RawFd, |
no test coverage detected