MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / start_http_path_thread

Function start_http_path_thread

vmm/src/api/http/mod.rs:407–431  ·  view source on GitHub ↗
(
    path: &str,
    api_notifier: EventFd,
    api_sender: Sender<ApiRequest>,
    seccomp_action: &SeccompAction,
    exit_evt: EventFd,
    hypervisor_type: HypervisorType,
    landlock_enable: bo

Source from the content-addressed store, hash-verified

405}
406
407pub 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
433pub fn start_http_fd_thread(
434 fd: RawFd,

Callers 1

start_vmm_threadFunction · 0.85

Calls 1

start_http_threadFunction · 0.85

Tested by

no test coverage detected