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:
Samuel Ortiz 2019-03-18 22:03:00 +01:00
parent c6c5e10a04
commit a7bdf5ee48

View File

@ -109,6 +109,9 @@ pub enum Error {
/// Write to the serial console failed.
Serial(vmm_sys_util::Error),
/// Cannot configure the IRQ.
Irq(io::Error),
}
pub type Result<T> = result::Result<T, Error>;
@ -325,6 +328,8 @@ impl<'a> Vm<'a> {
.map_err(Error::VmSetup)?;
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 epoll = EpollContext::new().map_err(Error::EpollError)?;