mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
In order to group together some functions that can be shared across virtio transport layers, this commit introduces a new trait called VirtioTransport. The first function of this trait being ioeventfds() as it is needed from both virtio-mmio and virtio-pci devices, represented by MmioDevice and VirtioPciDevice structures respectively. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
25 lines
646 B
Rust
25 lines
646 B
Rust
// Copyright © 2019 Intel Corporation
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
use vmm_sys_util::eventfd::EventFd;
|
|
#[cfg(feature = "pci_support")]
|
|
mod pci_common_config;
|
|
#[cfg(feature = "pci_support")]
|
|
mod pci_device;
|
|
#[cfg(feature = "pci_support")]
|
|
pub use pci_common_config::VirtioPciCommonConfig;
|
|
#[cfg(feature = "pci_support")]
|
|
pub use pci_device::VirtioPciDevice;
|
|
|
|
#[cfg(feature = "mmio_support")]
|
|
mod mmio;
|
|
#[cfg(feature = "mmio_support")]
|
|
pub use mmio::MmioDevice;
|
|
#[cfg(feature = "mmio_support")]
|
|
pub const NOTIFY_REG_OFFSET: u32 = 0x50;
|
|
|
|
pub trait VirtioTransport {
|
|
fn ioeventfds(&self, base_addr: u64) -> Vec<(&EventFd, u64)>;
|
|
}
|