From a7bdf5ee48ad4d0451a1c61712e85ade256bd397 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Mon, 18 Mar 2019 22:03:00 +0100 Subject: [PATCH] vmm: Register an irqfd for our serial device And get console input working. Signed-off-by: Samuel Ortiz --- vmm/src/vm.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index 9b9c7f3ae..fdfcf2a7d 100644 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -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 = result::Result; @@ -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)?;