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 <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2020-04-15 16:32:33 +01:00 committed by Samuel Ortiz
parent a8ec8f3326
commit 1beb62ed2d

View File

@ -482,7 +482,9 @@ impl Vm {
) )
.map_err(Error::KernelLoad)? .map_err(Error::KernelLoad)?
} }
_ => panic!("Invalid elf file"), Err(e) => {
return Err(Error::KernelLoad(e));
}
}; };
linux_loader::loader::load_cmdline( linux_loader::loader::load_cmdline(