mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
pci: vfio: Filter out some PCI extended capabilities
There are PCI extended capabilities that can't be passed through the VM as they would be unusable from a guest perspective. That's why we introduce a way to patch what is returned to the guest when the PCI configuration space is accessed. The list of patches is created from the parsing of the extended capabilities in that case, and particularly based on the presence of the SRIOV and Resizable BAR capabilities. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com> Signed-off-by: Steven Dake <sdake@lambdal.com>
This commit is contained in:
@@ -11,6 +11,7 @@ use crate::{
|
||||
use anyhow::anyhow;
|
||||
use hypervisor::HypervisorVmError;
|
||||
use std::any::Any;
|
||||
use std::collections::HashMap;
|
||||
use std::os::unix::prelude::AsRawFd;
|
||||
use std::ptr::null_mut;
|
||||
use std::sync::{Arc, Barrier, Mutex};
|
||||
@@ -112,6 +113,7 @@ impl VfioUserPciDevice {
|
||||
msi_interrupt_manager,
|
||||
legacy_interrupt_group,
|
||||
vfio_wrapper: Arc::new(vfio_wrapper) as Arc<dyn Vfio>,
|
||||
patches: HashMap::new(),
|
||||
};
|
||||
|
||||
// No need to parse capabilities from the device if on the restore path.
|
||||
|
||||
Reference in New Issue
Block a user