diff --git a/vm-virtio/src/device.rs b/vm-virtio/src/device.rs index d0a7a5b45..6c4a79088 100644 --- a/vm-virtio/src/device.rs +++ b/vm-virtio/src/device.rs @@ -9,7 +9,7 @@ use super::*; use pci::{PciBarConfiguration, PciCapability}; use std::sync::Arc; -use vm_memory::GuestMemoryMmap; +use vm_memory::{GuestAddress, GuestMemoryMmap, GuestUsize}; use vmm_sys_util::eventfd::EventFd; pub enum VirtioInterruptType { @@ -23,6 +23,19 @@ pub type VirtioInterrupt = Box< + Sync, >; +#[derive(Clone)] +pub struct VirtioSharedMemory { + pub offset: u64, + pub len: u64, +} + +#[derive(Clone)] +pub struct VirtioSharedMemoryList { + pub addr: GuestAddress, + pub len: GuestUsize, + pub region_list: Vec, +} + /// Trait for virtio devices to be driven by a virtio transport. /// /// The lifecycle of a virtio device is to be moved to a virtio transport, which will then query the @@ -76,4 +89,9 @@ pub trait VirtioDevice: Send { fn get_device_caps(&self) -> Vec> { Vec::new() } + + /// Returns the list of shared memory regions required by the device. + fn get_shm_regions(&self) -> Option { + None + } }