mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-21 20:15:21 +00:00
main: Improve the error reporting when creating the hypervisor object
The ::new() does very little beyond trying to open the /dev/kvm device so provide a hint to the user about what has gone wrong. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
1d3c3bc6ec
commit
29b74804e1
11
src/main.rs
11
src/main.rs
@ -324,7 +324,16 @@ fn start_vmm(cmd_arguments: ArgMatches) {
|
||||
} else {
|
||||
SeccompAction::Trap
|
||||
};
|
||||
let hypervisor = hypervisor::new().unwrap();
|
||||
let hypervisor = match hypervisor::new() {
|
||||
Ok(h) => h,
|
||||
Err(e) => {
|
||||
eprintln!(
|
||||
"Failed to open hypervisor interface (is /dev/kvm available?): {:?}",
|
||||
e
|
||||
);
|
||||
process::exit(1);
|
||||
}
|
||||
};
|
||||
let vmm_thread = match vmm::start_vmm_thread(
|
||||
env!("CARGO_PKG_VERSION").to_string(),
|
||||
api_socket_path,
|
||||
|
Loading…
x
Reference in New Issue
Block a user