mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-11-04 19:11:11 +00:00
bin, vmm: Centralise the net syntax
This will allow the syntax to be reused with cloud-hypervsor binary and ch-remote. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
41d7b3a387
commit
9df601a1df
@ -131,12 +131,7 @@ fn create_app<'a, 'b>(
|
||||
.arg(
|
||||
Arg::with_name("net")
|
||||
.long("net")
|
||||
.help(
|
||||
"Network parameters \
|
||||
\"tap=<if_name>,ip=<ip_addr>,mask=<net_mask>,mac=<mac_addr>,iommu=on|off,\
|
||||
num_queues=<number_of_queues>,queue_size=<size_of_each_queue>,\
|
||||
vhost_user=<vhost_user_enable>,socket=<vhost_user_socket_path>\"",
|
||||
)
|
||||
.help(config::NetConfig::SYNTAX)
|
||||
.takes_value(true)
|
||||
.min_values(1)
|
||||
.group("vm-config"),
|
||||
|
@ -553,6 +553,11 @@ fn default_netconfig_queue_size() -> u16 {
|
||||
}
|
||||
|
||||
impl NetConfig {
|
||||
pub const SYNTAX: &'static str = "Network parameters \
|
||||
\"tap=<if_name>,ip=<ip_addr>,mask=<net_mask>,mac=<mac_addr>,iommu=on|off,\
|
||||
num_queues=<number_of_queues>,queue_size=<size_of_each_queue>,\
|
||||
vhost_user=<vhost_user_enable>,socket=<vhost_user_socket_path>\"";
|
||||
|
||||
pub fn parse(net: &str) -> Result<Self> {
|
||||
// Split the parameters based on the comma delimiter
|
||||
let params_list: Vec<&str> = net.split(',').collect();
|
||||
|
Loading…
Reference in New Issue
Block a user