mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
pci: Remove ioeventfds() from PciDevice trait
The PciDevice trait is supposed to describe only functions related to PCI. The specific method ioeventfds() has nothing to do with PCI, but instead would be more specific to virtio transport devices. This commit removes the ioeventfds() method from the PciDevice trait, adding some convenient helper as_any() to retrieve the Any trait from the structure behing the PciDevice trait. This is the only way to keep calling into ioeventfds() function from VirtioPciDevice, so that we can still properly reprogram the PCI BAR. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
3be95dbf93
commit
de21c9ba4f
@@ -20,6 +20,7 @@ use pci::{
|
||||
PciCapabilityID, PciClassCode, PciConfiguration, PciDevice, PciDeviceError, PciHeaderType,
|
||||
PciSubclass, MSIX_TABLE_ENTRY_SIZE,
|
||||
};
|
||||
use std::any::Any;
|
||||
use std::os::unix::io::AsRawFd;
|
||||
use std::ptr::null_mut;
|
||||
use std::sync::Arc;
|
||||
@@ -1045,4 +1046,8 @@ impl PciDevice for VfioPciDevice {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn as_any(&mut self) -> &mut dyn Any {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user