mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-31 00:45:22 +00:00
vhost_user_net: Consolidate the vhost-user-net backend syntax
Rather than repeat syntax for the vhost-user-net backend in multiple places store it in one place and reference it from the required places. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
0d2be3b6d4
commit
3220292d45
@ -21,11 +21,7 @@ fn main() {
|
|||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("net-backend")
|
Arg::with_name("net-backend")
|
||||||
.long("net-backend")
|
.long("net-backend")
|
||||||
.help(
|
.help(vhost_user_net::SYNTAX)
|
||||||
"vhost-user-net backend parameters \
|
|
||||||
\"ip=<ip_addr>,mask=<net_mask>,sock=<socket_path>,\
|
|
||||||
num_queues=<number_of_queues>,queue_size=<size_of_each_queue>,tap=<if_name>\"",
|
|
||||||
)
|
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.min_values(1),
|
.min_values(1),
|
||||||
)
|
)
|
||||||
|
@ -235,11 +235,7 @@ fn create_app<'a, 'b>(
|
|||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("net-backend")
|
Arg::with_name("net-backend")
|
||||||
.long("net-backend")
|
.long("net-backend")
|
||||||
.help(
|
.help(vhost_user_net::SYNTAX)
|
||||||
"vhost-user-net backend parameters \
|
|
||||||
\"ip=<ip_addr>,mask=<net_mask>,sock=<socket_path>,\
|
|
||||||
num_queues=<number_of_queues>,queue_size=<size_of_each_queue>,tap=<if_name>\"",
|
|
||||||
)
|
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.conflicts_with_all(&["block-backend", "kernel"])
|
.conflicts_with_all(&["block-backend", "kernel"])
|
||||||
.min_values(1),
|
.min_values(1),
|
||||||
|
@ -77,6 +77,10 @@ pub enum Error {
|
|||||||
OpenTap(vm_virtio::net_util::Error),
|
OpenTap(vm_virtio::net_util::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub const SYNTAX: &str = "vhost-user-net backend parameters \
|
||||||
|
\"ip=<ip_addr>,mask=<net_mask>,sock=<socket_path>,\
|
||||||
|
num_queues=<number_of_queues>,queue_size=<size_of_each_queue>,tap=<if_name>\"";
|
||||||
|
|
||||||
impl fmt::Display for Error {
|
impl fmt::Display for Error {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
write!(f, "vhost_user_net_error: {:?}", self)
|
write!(f, "vhost_user_net_error: {:?}", self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user