vmm: Switch to storing VmConfig inside an Arc<Mutex<>>

This permits the runtime reconfiguration of the VM.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2019-12-05 14:50:38 +00:00
parent c063bb8d30
commit 1722708612
6 changed files with 65 additions and 50 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ use crate::api::{
use micro_http::{Body, Method, Request, Response, StatusCode, Version};
use serde_json::Error as SerdeError;
use std::sync::mpsc::Sender;
use std::sync::Arc;
use std::sync::{Arc, Mutex};
use vmm_sys_util::eventfd::EventFd;
/// Errors associated with VMM management
@@ -81,7 +81,7 @@ impl EndpointHandler for VmCreate {
};
// Call vm_create()
match vm_create(api_notifier, api_sender, Arc::new(vm_config))
match vm_create(api_notifier, api_sender, Arc::new(Mutex::new(vm_config)))
.map_err(HttpError::VmCreate)
{
Ok(_) => Response::new(Version::Http11, StatusCode::NoContent),