mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Group virtio-mem fields under a dedicated structure
This patch simplifies the code as we have one single Option for the VirtioMemZone. This also prepares for storing additional information related to the virtio-mem region. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -2430,10 +2430,7 @@ impl DeviceManager {
|
||||
let mm = self.memory_manager.clone();
|
||||
let mm = mm.lock().unwrap();
|
||||
for (_memory_zone_id, memory_zone) in mm.memory_zones().iter() {
|
||||
if let (Some(region), Some(resize)) = (
|
||||
memory_zone.virtio_mem_region(),
|
||||
memory_zone.virtio_mem_resize(),
|
||||
) {
|
||||
if let Some(virtio_mem_zone) = memory_zone.virtio_mem_zone() {
|
||||
let id = self.next_device_name(MEM_DEVICE_NAME_PREFIX)?;
|
||||
|
||||
#[cfg(not(feature = "acpi"))]
|
||||
@@ -2445,8 +2442,9 @@ impl DeviceManager {
|
||||
let virtio_mem_device = Arc::new(Mutex::new(
|
||||
virtio_devices::Mem::new(
|
||||
id.clone(),
|
||||
®ion,
|
||||
resize
|
||||
virtio_mem_zone.region(),
|
||||
virtio_mem_zone
|
||||
.resize_handler()
|
||||
.try_clone()
|
||||
.map_err(DeviceManagerError::TryCloneVirtioMemResize)?,
|
||||
self.seccomp_action.clone(),
|
||||
|
||||
Reference in New Issue
Block a user