mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
devices: Create Interrupt trait to abstract interrupt delivery
This commit anticipate the future need from having support for both in kernel and userspace IOAPIC. The way to signal an interrupt from the serial device will vary depending on the use case, but this should be independent from the serial implementation itself. That's why this patch provides a generic trait for the serial device to call from, so that it can trigger interrupts independently from the IOAPIC type chosen (in kernel vs userspace). Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
2a7fbe8eae
commit
c8c4a4d444
@@ -14,7 +14,7 @@ extern crate vm_memory;
|
||||
extern crate vmm_sys_util;
|
||||
|
||||
use std::fs::File;
|
||||
use std::io;
|
||||
use std::{io, result};
|
||||
|
||||
mod bus;
|
||||
pub mod legacy;
|
||||
@@ -58,3 +58,7 @@ pub enum Error {
|
||||
},
|
||||
IoError(io::Error),
|
||||
}
|
||||
|
||||
pub trait Interrupt: Send {
|
||||
fn deliver(&self) -> result::Result<(), std::io::Error>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user