mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: memory_manager: Pass MemoryConfig to simplify the new() prototype
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
committed by
Rob Bradford
parent
622f3f8fb6
commit
ef2b11ee6c
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user