mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: api: Add HTTP server
The Cloud Hyper HTTP server runs a synchronous, multi-threaded loop that receives HTTP requests and tries to call the corresponding endpoint handlers for the requests URIs. An endpoint handler will parse the HTTP request and potentially translate it into and IPC request. The handler holds an notifier and an mspc Sender for respectively notifying and sending the IPC payload to the VMM API server. The handler then waits for an API server response and translate it back into an HTTP response. The HTTP server is responsible for sending the reponse back to the caller. The HTTP server uses a static routes hash table that maps URIs to endpoint handlers. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
extern crate vmm_sys_util;
|
||||
@@ -47,6 +50,9 @@ pub enum Error {
|
||||
/// Cannot start a VM from the API
|
||||
ApiVmStart(ApiError),
|
||||
|
||||
/// Cannot bind to the UNIX domain socket path
|
||||
Bind(io::Error),
|
||||
|
||||
/// Cannot clone EventFd.
|
||||
EventFdClone(io::Error),
|
||||
|
||||
@@ -62,6 +68,9 @@ pub enum Error {
|
||||
/// Cannot create epoll context.
|
||||
Epoll(io::Error),
|
||||
|
||||
/// Cannot create HTTP thread
|
||||
HttpThreadSpawn(io::Error),
|
||||
|
||||
/// Cannot handle the VM STDIN stream
|
||||
Stdin(VmError),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user