mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
main: Make supplying the commandline optional
If no commandline is supplied replace with an empty string. No kernel commandline is needed when using the firmware to boot. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
2c94529660
commit
adb0abf400
14
src/main.rs
14
src/main.rs
@ -69,17 +69,21 @@ fn main() {
|
|||||||
.expect("Missing argument: kernel");
|
.expect("Missing argument: kernel");
|
||||||
let kernel_path = kernel_arg.as_path();
|
let kernel_path = kernel_arg.as_path();
|
||||||
|
|
||||||
let cmdline = cmd_arguments
|
|
||||||
.value_of("cmdline")
|
|
||||||
.map(std::string::ToString::to_string)
|
|
||||||
.expect("Missing argument: cmdline");
|
|
||||||
|
|
||||||
let disk_arg = cmd_arguments
|
let disk_arg = cmd_arguments
|
||||||
.value_of("disk")
|
.value_of("disk")
|
||||||
.map(PathBuf::from)
|
.map(PathBuf::from)
|
||||||
.expect("Missing argument: disk");
|
.expect("Missing argument: disk");
|
||||||
let disk_path = disk_arg.as_path();
|
let disk_path = disk_arg.as_path();
|
||||||
|
|
||||||
|
let cmdline = if cmd_arguments.is_present("cmdline") {
|
||||||
|
cmd_arguments
|
||||||
|
.value_of("cmdline")
|
||||||
|
.map(std::string::ToString::to_string)
|
||||||
|
.unwrap()
|
||||||
|
} else {
|
||||||
|
String::new()
|
||||||
|
};
|
||||||
|
|
||||||
let mut net_params = None;
|
let mut net_params = None;
|
||||||
if cmd_arguments.is_present("net") {
|
if cmd_arguments.is_present("net") {
|
||||||
if let Some(net) = cmd_arguments.value_of("net") {
|
if let Some(net) = cmd_arguments.value_of("net") {
|
||||||
|
Loading…
Reference in New Issue
Block a user