diff --git a/vm-virtio/src/device.rs b/vm-virtio/src/device.rs index ab05ef073..f149fafda 100644 --- a/vm-virtio/src/device.rs +++ b/vm-virtio/src/device.rs @@ -34,6 +34,15 @@ pub trait VirtioInterrupt: Send + Sync { pub type VirtioIommuRemapping = Box std::result::Result + Send + Sync>; +#[derive(Clone)] +pub struct UserspaceMapping { + pub host_addr: u64, + pub mem_slot: u32, + pub addr: GuestAddress, + pub len: GuestUsize, + pub mergeable: bool, +} + #[derive(Clone)] pub struct VirtioSharedMemory { pub offset: u64, @@ -120,6 +129,11 @@ pub trait VirtioDevice: Send { fn update_memory(&mut self, _mem: &GuestMemoryMmap) -> std::result::Result<(), Error> { Ok(()) } + + /// Returns the list of userspace mappings associated with this device. + fn userspace_mappings(&self) -> Vec { + Vec::new() + } } /// Trait providing address translation the same way a physical DMA remapping