mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-21 07:21:15 +00:00
vm-virtio: pci: Make sure to return the correct list of BARs
By adding the shared memory regions to the list of BARs, we make sure the DeviceManager will register it as a BAR on the PCI bus. Without this, when PCI BAR reprogramming happens, the PCI bus errors since it does not know about any BAR at the specified address. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
187b1eec8b
commit
49cc73a4ca
@ -757,6 +757,11 @@ impl PciDevice for VirtioPciDevice {
|
|||||||
PciDeviceError::IoRegistrationFailed(shm_list.addr.raw_value(), e)
|
PciDeviceError::IoRegistrationFailed(shm_list.addr.raw_value(), e)
|
||||||
})? as u8;
|
})? as u8;
|
||||||
|
|
||||||
|
let region_type = PciBarRegionType::Memory64BitRegion;
|
||||||
|
ranges.push((shm_list.addr, shm_list.len, region_type));
|
||||||
|
self.bar_regions
|
||||||
|
.push((shm_list.addr, shm_list.len, region_type));
|
||||||
|
|
||||||
for (idx, shm) in shm_list.region_list.iter().enumerate() {
|
for (idx, shm) in shm_list.region_list.iter().enumerate() {
|
||||||
let shm_cap = VirtioPciCap64::new(
|
let shm_cap = VirtioPciCap64::new(
|
||||||
PciCapabilityType::SharedMemoryConfig,
|
PciCapabilityType::SharedMemoryConfig,
|
||||||
|
Loading…
Reference in New Issue
Block a user