mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-03 11:25:20 +00:00
vmm: Register an irqfd for our serial device
And get console input working. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
c6c5e10a04
commit
a7bdf5ee48
@ -109,6 +109,9 @@ pub enum Error {
|
|||||||
|
|
||||||
/// Write to the serial console failed.
|
/// Write to the serial console failed.
|
||||||
Serial(vmm_sys_util::Error),
|
Serial(vmm_sys_util::Error),
|
||||||
|
|
||||||
|
/// Cannot configure the IRQ.
|
||||||
|
Irq(io::Error),
|
||||||
}
|
}
|
||||||
pub type Result<T> = result::Result<T, Error>;
|
pub type Result<T> = result::Result<T, Error>;
|
||||||
|
|
||||||
@ -325,6 +328,8 @@ impl<'a> Vm<'a> {
|
|||||||
.map_err(Error::VmSetup)?;
|
.map_err(Error::VmSetup)?;
|
||||||
|
|
||||||
let device_manager = DeviceManager::new().map_err(|_| Error::DeviceManager)?;
|
let device_manager = DeviceManager::new().map_err(|_| Error::DeviceManager)?;
|
||||||
|
fd.register_irqfd(device_manager.serial_evt.as_raw_fd(), 4)
|
||||||
|
.map_err(Error::Irq)?;
|
||||||
|
|
||||||
// Let's add our STDIN fd.
|
// Let's add our STDIN fd.
|
||||||
let epoll = EpollContext::new().map_err(Error::EpollError)?;
|
let epoll = EpollContext::new().map_err(Error::EpollError)?;
|
||||||
|
Loading…
Reference in New Issue
Block a user