mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
cloud-hypervisor: Application handling
We will only support a --kernel option for now. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
31
src/main.rs
31
src/main.rs
@@ -1,3 +1,32 @@
|
||||
// Copyright © 2019 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#[macro_use(crate_version, crate_authors)]
|
||||
extern crate clap;
|
||||
|
||||
use clap::{App, Arg};
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user