vmm: memory_manager: Pass MemoryConfig to simplify the new() prototype

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz
2020-03-16 18:04:50 +01:00
committed by Rob Bradford
parent 622f3f8fb6
commit ef2b11ee6c
2 changed files with 15 additions and 26 deletions

View File

@@ -334,21 +334,14 @@ impl Vm {
.ok_or(Error::CreateSystemAllocator)?,
));
let memory_config = config.lock().unwrap().memory.clone();
let memory_manager = MemoryManager::new(
allocator.clone(),
fd.clone(),
memory_config.size,
memory_config.hotplug_method,
memory_config.hotplug_size,
&memory_config.file,
memory_config.mergeable,
&config.lock().unwrap().memory.clone(),
)
.map_err(Error::MemoryManager)?;
let guest_memory = memory_manager.lock().unwrap().guest_memory();
let device_manager = DeviceManager::new(
fd.clone(),
config.clone(),