diff --git a/pci/src/bus.rs b/pci/src/bus.rs index 0ef391e48..4c5c0235f 100644 --- a/pci/src/bus.rs +++ b/pci/src/bus.rs @@ -5,7 +5,7 @@ use crate::configuration::{ PciBarRegionType, PciBridgeSubclass, PciClassCode, PciConfiguration, PciHeaderType, }; -use crate::device::{Error as PciDeviceError, PciDevice}; +use crate::device::{DeviceRelocation, Error as PciDeviceError, PciDevice}; use byteorder::{ByteOrder, LittleEndian}; use devices::BusDevice; use std; @@ -75,15 +75,19 @@ pub struct PciBus { /// Devices attached to this bus. /// Device 0 is host bridge. devices: Vec>>, + _device_reloc: Arc, } impl PciBus { - pub fn new(pci_root: PciRoot) -> Self { + pub fn new(pci_root: PciRoot, device_reloc: Arc) -> Self { let mut devices: Vec>> = Vec::new(); devices.push(Arc::new(Mutex::new(pci_root))); - PciBus { devices } + PciBus { + devices, + _device_reloc: device_reloc, + } } pub fn register_mapping( diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index 5581532d6..381728fa5 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -537,7 +537,7 @@ impl DeviceManager { #[cfg(feature = "pci_support")] { let pci_root = PciRoot::new(None); - let mut pci_bus = PciBus::new(pci_root); + let mut pci_bus = PciBus::new(pci_root, address_manager.clone()); let (mut iommu_device, iommu_mapping) = if vm_info.vm_cfg.iommu { let (device, mapping) =