mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm, main: Optionalise creation of API server
Only if we have a valid API server path then create the API server. For now this has no functional change there is a default API server path in the clap handling but rather prepares to do so optionally. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -245,7 +245,7 @@ impl Serialize for PciDeviceInfo {
|
||||
|
||||
pub fn start_vmm_thread(
|
||||
vmm_version: String,
|
||||
http_path: &str,
|
||||
http_path: &Option<String>,
|
||||
api_event: EventFd,
|
||||
api_sender: Sender<ApiRequest>,
|
||||
api_receiver: Receiver<ApiRequest>,
|
||||
@@ -276,9 +276,10 @@ pub fn start_vmm_thread(
|
||||
})
|
||||
.map_err(Error::VmmThreadSpawn)?;
|
||||
|
||||
// The VMM thread is started, we can start serving HTTP requests
|
||||
api::start_http_thread(http_path, http_api_event, api_sender, seccomp_action)?;
|
||||
|
||||
if let Some(http_path) = http_path {
|
||||
// The VMM thread is started, we can start serving HTTP requests
|
||||
api::start_http_thread(http_path, http_api_event, api_sender, seccomp_action)?;
|
||||
}
|
||||
Ok(thread)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user