mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-03 03:15:20 +00:00
main: Fix --net behavior
Recent refactoring of the flags parsing broke the --net behavior where the network tap interface should be created by the VMM if the user does not provide any argument to this option. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
e52132c8c8
commit
8e9e7601f5
11
src/main.rs
11
src/main.rs
@ -80,9 +80,14 @@ fn main() {
|
|||||||
.map(std::string::ToString::to_string)
|
.map(std::string::ToString::to_string)
|
||||||
.unwrap_or_else(String::new);
|
.unwrap_or_else(String::new);
|
||||||
|
|
||||||
let net_params = cmd_arguments
|
let mut net_params = None;
|
||||||
.value_of("net")
|
if cmd_arguments.is_present("net") {
|
||||||
.map(std::string::ToString::to_string);
|
if let Some(net) = cmd_arguments.value_of("net") {
|
||||||
|
net_params = Some(net.to_string());
|
||||||
|
} else {
|
||||||
|
net_params = Some(String::new())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let rng_path = match cmd_arguments.occurrences_of("rng") {
|
let rng_path = match cmd_arguments.occurrences_of("rng") {
|
||||||
0 => None,
|
0 => None,
|
||||||
|
Loading…
Reference in New Issue
Block a user