diff --git a/vm-virtio/src/device.rs b/vm-virtio/src/device.rs index 6c4a79088..b2291b08e 100644 --- a/vm-virtio/src/device.rs +++ b/vm-virtio/src/device.rs @@ -7,7 +7,6 @@ // SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause use super::*; -use pci::{PciBarConfiguration, PciCapability}; use std::sync::Arc; use vm_memory::{GuestAddress, GuestMemoryMmap, GuestUsize}; use vmm_sys_util::eventfd::EventFd; @@ -80,16 +79,6 @@ pub trait VirtioDevice: Send { None } - /// Returns any additional BAR configuration required by the device. - fn get_device_bars(&self) -> Vec { - Vec::new() - } - - /// Returns any additional capabilities required by the device. - fn get_device_caps(&self) -> Vec> { - Vec::new() - } - /// Returns the list of shared memory regions required by the device. fn get_shm_regions(&self) -> Option { None diff --git a/vm-virtio/src/transport/pci_device.rs b/vm-virtio/src/transport/pci_device.rs index fca7dbfe1..a72a3d872 100755 --- a/vm-virtio/src/transport/pci_device.rs +++ b/vm-virtio/src/transport/pci_device.rs @@ -559,22 +559,6 @@ impl PciDevice for VirtioPciDevice { // Once the BARs are allocated, the capabilities can be added to the PCI configuration. self.add_pci_capabilities(virtio_pci_bar)?; - // Allocate the device specific BARs. - for config in self.device.get_device_bars() { - let device_bar_addr = allocator - .allocate_mmio_addresses(None, config.get_size(), None) - .ok_or_else(|| PciDeviceError::IoAllocationFailed(config.get_size()))?; - config.set_address(device_bar_addr.raw_value()); - let _device_bar = self.configuration.add_pci_bar(&config).map_err(|e| { - PciDeviceError::IoRegistrationFailed(device_bar_addr.raw_value(), e) - })?; - ranges.push(( - device_bar_addr, - config.get_size(), - PciBarRegionType::Memory64BitRegion, - )); - } - Ok(ranges) }