mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-21 07:21:15 +00:00
vhost_user_block: Consolidate the vhost-user-block backend syntax
Rather than repeat syntax for the vhost-user-block 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
3220292d45
commit
f3f398eb44
@ -23,11 +23,7 @@ fn main() {
|
|||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("block-backend")
|
Arg::with_name("block-backend")
|
||||||
.long("block-backend")
|
.long("block-backend")
|
||||||
.help(
|
.help(vhost_user_block::SYNTAX)
|
||||||
"vhost-user-block backend parameters \
|
|
||||||
\"path=<image_path>,socket=<socket_path>,num_queues=<number_of_queues>,\
|
|
||||||
readonly=true|false,direct=true|false,poll_queue=true|false\"",
|
|
||||||
)
|
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.min_values(1),
|
.min_values(1),
|
||||||
)
|
)
|
||||||
|
@ -243,11 +243,7 @@ fn create_app<'a, 'b>(
|
|||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("block-backend")
|
Arg::with_name("block-backend")
|
||||||
.long("block-backend")
|
.long("block-backend")
|
||||||
.help(
|
.help(vhost_user_block::SYNTAX)
|
||||||
"vhost-user-block backend parameters \
|
|
||||||
\"path=<image_path>,socket=<socket_path>,num_queues=<number_of_queues>,\
|
|
||||||
readonly=true|false,direct=true|false,poll_queue=true|false\"",
|
|
||||||
)
|
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.conflicts_with_all(&["net-backend", "kernel"])
|
.conflicts_with_all(&["net-backend", "kernel"])
|
||||||
.min_values(1),
|
.min_values(1),
|
||||||
|
@ -77,6 +77,10 @@ enum Error {
|
|||||||
HandleEventUnknownEvent,
|
HandleEventUnknownEvent,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub const SYNTAX: &str = "vhost-user-block backend parameters \
|
||||||
|
\"path=<image_path>,socket=<socket_path>,num_queues=<number_of_queues>,\
|
||||||
|
readonly=true|false,direct=true|false,poll_queue=true|false\"";
|
||||||
|
|
||||||
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_block_error: {:?}", self)
|
write!(f, "vhost_user_block_error: {:?}", self)
|
||||||
|
Loading…
Reference in New Issue
Block a user