mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vm-virtio: Remove unneeded code
Remove legacy code coming from Firecracker and/or Crosvm. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
30266a41be
commit
8dc06aa50d
@@ -17,7 +17,6 @@ extern crate virtio_bindings;
|
|||||||
extern crate vm_memory;
|
extern crate vm_memory;
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::fs::File;
|
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
mod block;
|
mod block;
|
||||||
@@ -88,35 +87,12 @@ const INTERRUPT_STATUS_CONFIG_CHANGED: u32 = 0x2;
|
|||||||
pub enum ActivateError {
|
pub enum ActivateError {
|
||||||
EpollCtl(std::io::Error),
|
EpollCtl(std::io::Error),
|
||||||
BadActivate,
|
BadActivate,
|
||||||
#[cfg(feature = "vsock")]
|
|
||||||
BadVhostActivate(self::vhost::Error),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type ActivateResult = std::result::Result<(), ActivateError>;
|
pub type ActivateResult = std::result::Result<(), ActivateError>;
|
||||||
|
|
||||||
pub type DeviceEventT = u16;
|
pub type DeviceEventT = u16;
|
||||||
|
|
||||||
/// The payload is used to handle events where the internal state of the VirtIO device
|
|
||||||
/// needs to be changed.
|
|
||||||
#[allow(clippy::large_enum_variant)]
|
|
||||||
pub enum EpollHandlerPayload {
|
|
||||||
/// DrivePayload(disk_image)
|
|
||||||
DrivePayload(File),
|
|
||||||
/// Events that do not need a payload.
|
|
||||||
Empty,
|
|
||||||
}
|
|
||||||
|
|
||||||
type Result<T> = std::result::Result<T, Error>;
|
|
||||||
|
|
||||||
pub trait EpollHandler: Send {
|
|
||||||
fn handle_event(
|
|
||||||
&mut self,
|
|
||||||
device_event: DeviceEventT,
|
|
||||||
event_flags: u32,
|
|
||||||
payload: EpollHandlerPayload,
|
|
||||||
) -> Result<()>;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
FailedReadingQueue {
|
FailedReadingQueue {
|
||||||
|
|||||||
Reference in New Issue
Block a user