2019-10-23 14:36:01 +00:00
|
|
|
// Copyright 2019 Red Hat, Inc. All Rights Reserved.
|
|
|
|
//
|
|
|
|
// Portions Copyright 2019 Intel Corporation. All Rights Reserved.
|
|
|
|
//
|
|
|
|
// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
|
|
//
|
|
|
|
// Portions Copyright 2017 The Chromium OS Authors. All rights reserved.
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: (Apache-2.0 AND BSD-3-Clause)
|
|
|
|
|
|
|
|
#[macro_use(crate_version, crate_authors)]
|
|
|
|
extern crate clap;
|
2020-01-20 16:10:21 +00:00
|
|
|
extern crate vhost_user_block;
|
2019-10-23 14:36:01 +00:00
|
|
|
|
|
|
|
use clap::{App, Arg};
|
2020-01-21 15:16:38 +00:00
|
|
|
use vhost_user_block::start_block_backend;
|
2019-10-23 14:36:01 +00:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let cmd_arguments = App::new("vhost-user-blk backend")
|
|
|
|
.version(crate_version!())
|
|
|
|
.author(crate_authors!())
|
|
|
|
.about("Launch a vhost-user-blk backend.")
|
|
|
|
.arg(
|
2020-01-20 14:28:06 +00:00
|
|
|
Arg::with_name("block-backend")
|
|
|
|
.long("block-backend")
|
2020-05-08 15:11:00 +00:00
|
|
|
.help(vhost_user_block::SYNTAX)
|
2019-10-23 14:36:01 +00:00
|
|
|
.takes_value(true)
|
|
|
|
.min_values(1),
|
|
|
|
)
|
|
|
|
.get_matches();
|
|
|
|
|
2020-01-21 15:16:38 +00:00
|
|
|
let backend_command = cmd_arguments.value_of("block-backend").unwrap();
|
|
|
|
start_block_backend(backend_command);
|
2019-10-23 14:36:01 +00:00
|
|
|
}
|