mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +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:
committed by
Sebastien Boeuf
parent
1d3c3bc6ec
commit
29b74804e1
11
src/main.rs
11
src/main.rs
@@ -324,7 +324,16 @@ fn start_vmm(cmd_arguments: ArgMatches) {
|
|||||||
} else {
|
} else {
|
||||||
SeccompAction::Trap
|
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(
|
let vmm_thread = match vmm::start_vmm_thread(
|
||||||
env!("CARGO_PKG_VERSION").to_string(),
|
env!("CARGO_PKG_VERSION").to_string(),
|
||||||
api_socket_path,
|
api_socket_path,
|
||||||
|
|||||||
Reference in New Issue
Block a user