vmm: Add MMIO & PIO config devices for all PCI segments

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2021-10-05 15:00:23 +01:00
parent 4f5c179b9b
commit c886d71d29

View File

@ -1188,14 +1188,16 @@ impl DeviceManager {
} }
} }
for segment in &self.pci_segments {
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
self.bus_devices.push( if let Some(pci_config_io) = segment.pci_config_io.as_ref() {
Arc::clone(self.pci_segments[0].pci_config_io.as_ref().unwrap()) self.bus_devices
as Arc<Mutex<dyn BusDevice>>, .push(Arc::clone(pci_config_io) as Arc<Mutex<dyn BusDevice>>);
); }
self.bus_devices self.bus_devices
.push(Arc::clone(&self.pci_segments[0].pci_config_mmio) as Arc<Mutex<dyn BusDevice>>); .push(Arc::clone(&segment.pci_config_mmio) as Arc<Mutex<dyn BusDevice>>);
}
Ok(()) Ok(())
} }