mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-04 04:25:45 +00:00
main: Add arguments entry for vhost-user-net
Signed-off-by: Cathy Zhang <cathy.zhang@intel.com>
This commit is contained in:
parent
584a2cccee
commit
f21d54f6b0
15
src/main.rs
15
src/main.rs
@ -154,6 +154,17 @@ fn main() {
|
|||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.min_values(1),
|
.min_values(1),
|
||||||
)
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("vhost-user-net")
|
||||||
|
.long("vhost-user-net")
|
||||||
|
.help(
|
||||||
|
"Network parameters \"mac=<mac_addr>,\
|
||||||
|
sock=<socket_path>, num_queues=<number_of_queues>,\
|
||||||
|
queue_size=<size_of_each_queue>\"",
|
||||||
|
)
|
||||||
|
.takes_value(true)
|
||||||
|
.min_values(1),
|
||||||
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("v")
|
Arg::with_name("v")
|
||||||
.short("v")
|
.short("v")
|
||||||
@ -186,6 +197,9 @@ fn main() {
|
|||||||
let fs: Option<Vec<&str>> = cmd_arguments.values_of("fs").map(|x| x.collect());
|
let fs: Option<Vec<&str>> = cmd_arguments.values_of("fs").map(|x| x.collect());
|
||||||
let pmem: Option<Vec<&str>> = cmd_arguments.values_of("pmem").map(|x| x.collect());
|
let pmem: Option<Vec<&str>> = cmd_arguments.values_of("pmem").map(|x| x.collect());
|
||||||
let devices: Option<Vec<&str>> = cmd_arguments.values_of("device").map(|x| x.collect());
|
let devices: Option<Vec<&str>> = cmd_arguments.values_of("device").map(|x| x.collect());
|
||||||
|
let vhost_user_net: Option<Vec<&str>> = cmd_arguments
|
||||||
|
.values_of("vhost-user-net")
|
||||||
|
.map(|x| x.collect());
|
||||||
|
|
||||||
let log_level = match cmd_arguments.occurrences_of("v") {
|
let log_level = match cmd_arguments.occurrences_of("v") {
|
||||||
0 => LevelFilter::Error,
|
0 => LevelFilter::Error,
|
||||||
@ -224,6 +238,7 @@ fn main() {
|
|||||||
serial,
|
serial,
|
||||||
console,
|
console,
|
||||||
devices,
|
devices,
|
||||||
|
vhost_user_net,
|
||||||
}) {
|
}) {
|
||||||
Ok(config) => config,
|
Ok(config) => config,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user