mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: device_manager: Get device range from MemoryManager
This removes the duplication of these values. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -162,8 +162,6 @@ pub struct VmInfo<'a> {
|
||||
pub memory: &'a Arc<RwLock<GuestMemoryMmap>>,
|
||||
pub vm_fd: &'a Arc<VmFd>,
|
||||
pub vm_cfg: Arc<Mutex<VmConfig>>,
|
||||
pub start_of_device_area: GuestAddress,
|
||||
pub end_of_device_area: GuestAddress,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize, PartialEq)]
|
||||
@@ -318,15 +316,11 @@ impl Vm {
|
||||
)
|
||||
.map_err(Error::MemoryManager)?;
|
||||
|
||||
let start_of_device_area = memory_manager.lock().unwrap().start_of_device_area();
|
||||
let end_of_device_area = memory_manager.lock().unwrap().end_of_device_area();
|
||||
let guest_memory = memory_manager.lock().unwrap().guest_memory();
|
||||
let vm_info = VmInfo {
|
||||
memory: &guest_memory,
|
||||
vm_fd: &fd,
|
||||
vm_cfg: config.clone(),
|
||||
start_of_device_area,
|
||||
end_of_device_area,
|
||||
};
|
||||
|
||||
let device_manager = DeviceManager::new(
|
||||
|
||||
Reference in New Issue
Block a user