pub mod balloon;
pub mod blk;
pub mod fs;
pub mod mmio;
pub mod queue;
pub mod rng;
pub mod vsock;
pub const STATUS_ACKNOWLEDGE: u32 = 1;
pub const STATUS_DRIVER: u32 = 2;
pub const STATUS_DRIVER_OK: u32 = 4;
pub const STATUS_FEATURES_OK: u32 = 8;
pub const STATUS_FAILED: u32 = 0x80;
pub const VIRTIO_ID_BLOCK: u32 = 2;
pub const VIRTIO_ID_RNG: u32 = 4;
pub const VIRTIO_ID_VSOCK: u32 = 19;
pub const VIRTIO_ID_FS: u32 = 26;
#[derive(Clone, Copy, Debug)]
pub struct ShmRegion {
pub id: u8,
pub gpa: u64,
pub len: u64,
}
pub trait VirtioDevice: Send + Sync {
fn device_id(&self) -> u32;
fn vendor_id(&self) -> u32 {
0x554d4551
} fn num_queues(&self) -> usize;
fn queue_max_size(&self) -> u16 {
256
}
fn config(&self) -> Vec<u8> {
Vec::new()
}
fn features(&self) -> u64 {
1u64 << 32
}
fn notify(&self, q: u16);
fn activate(&self, queues: Vec<queue::Queue>);
fn snapshot_queues(&self) -> Vec<queue::Queue> {
Vec::new()
}
fn config_write(&self, _offset: usize, _value: u32) {}
fn shm_regions(&self) -> Vec<ShmRegion> {
Vec::new()
}
}