mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Add VirtioDevice::access_platform()
Adding this method to the trait will allow the virtio PCI code to access a feature conditional version of the access platform and simplify the logic. Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
@@ -188,6 +188,12 @@ pub trait VirtioDevice: Send {
|
|||||||
/// Set the access platform trait to let the device perform address
|
/// Set the access platform trait to let the device perform address
|
||||||
/// translations if needed.
|
/// translations if needed.
|
||||||
fn set_access_platform(&mut self, _access_platform: Arc<dyn AccessPlatform>) {}
|
fn set_access_platform(&mut self, _access_platform: Arc<dyn AccessPlatform>) {}
|
||||||
|
|
||||||
|
/// Returns the access platform only if VIRTIO_F_ACCESS_PLATFORM was
|
||||||
|
/// negotiated with the guest.
|
||||||
|
fn access_platform(&self) -> Option<Arc<dyn AccessPlatform>> {
|
||||||
|
None
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Trait to define address translation for devices managed by virtio-iommu
|
/// Trait to define address translation for devices managed by virtio-iommu
|
||||||
|
|||||||
Reference in New Issue
Block a user