mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 05:35: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");
|
||||
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
|
||||
.value_of("disk")
|
||||
.map(PathBuf::from)
|
||||
.expect("Missing argument: disk");
|
||||
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;
|
||||
if cmd_arguments.is_present("net") {
|
||||
if let Some(net) = cmd_arguments.value_of("net") {
|
||||
|
Loading…
Reference in New Issue
Block a user