From 1beb62ed2d70af539185c5d61c3ed47dbc49b625 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 15 Apr 2020 16:32:33 +0100 Subject: [PATCH] vmm: vm: Don't panic on kernel load error Rather than panic()ing when we get a kernel loading error populate the error upwards. Signed-off-by: Rob Bradford --- vmm/src/vm.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index 196a10469..04b4455c0 100755 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -482,7 +482,9 @@ impl Vm { ) .map_err(Error::KernelLoad)? } - _ => panic!("Invalid elf file"), + Err(e) => { + return Err(Error::KernelLoad(e)); + } }; linux_loader::loader::load_cmdline(