From eb46aa2b22caea1f92387854631092f33e754c24 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Fri, 6 Sep 2019 18:37:41 +0100 Subject: [PATCH] vmm: If acpi feature is disabled make "reboot" shutdown With ACPI disabled there is no way to support both reset and shutdown so make the VMM exit if the VM is rebootet (via i8042 or triple-fault reset.) Signed-off-by: Rob Bradford --- vmm/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vmm/src/lib.rs b/vmm/src/lib.rs index 10191ed97..b47f95cd9 100644 --- a/vmm/src/lib.rs +++ b/vmm/src/lib.rs @@ -61,9 +61,13 @@ pub fn boot_kernel(config: VmConfig) -> Result<()> { let mut vm = Vm::new(&vmm.kvm, &config).map_err(Error::VmNew)?; let entry = vm.load_kernel().map_err(Error::LoadKernel)?; + if vm.start(entry).map_err(Error::VmStart)? == ExitBehaviour::Shutdown { break; } + + #[cfg(not(feature = "acpi"))] + break; } Ok(())