2019-02-21 16:39:34 +00:00
|
|
|
// Copyright © 2019 Intel Corporation
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
//
|
|
|
|
|
2019-02-22 16:05:02 +00:00
|
|
|
extern crate vmm;
|
|
|
|
|
2019-02-21 16:39:34 +00:00
|
|
|
#[macro_use(crate_version, crate_authors)]
|
|
|
|
extern crate clap;
|
|
|
|
|
|
|
|
use clap::{App, Arg};
|
|
|
|
|
|
|
|
use std::path::PathBuf;
|
|
|
|
|
2019-02-21 16:04:44 +00:00
|
|
|
fn main() {
|
2019-02-21 16:39:34 +00:00
|
|
|
let cmd_arguments = App::new("cloud-hypervisor")
|
|
|
|
.version(crate_version!())
|
|
|
|
.author(crate_authors!())
|
|
|
|
.about("Launch a cloud-hypervisor VMM.")
|
|
|
|
.arg(
|
|
|
|
Arg::with_name("kernel")
|
|
|
|
.long("kernel")
|
|
|
|
.help("Path to kernel image (vmlinux)")
|
|
|
|
.takes_value(true),
|
|
|
|
)
|
|
|
|
.get_matches();
|
|
|
|
|
|
|
|
let kernel_path = cmd_arguments
|
|
|
|
.value_of("kernel")
|
|
|
|
.map(PathBuf::from)
|
|
|
|
.expect("Missing argument: kernel");
|
|
|
|
|
|
|
|
println!("Booting {:?}...", kernel_path.as_path());
|
2019-02-22 16:05:02 +00:00
|
|
|
|
|
|
|
vmm::test_vm()
|
2019-02-21 16:04:44 +00:00
|
|
|
}
|