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)
|
|
|
|
|
2020-01-20 16:10:21 +00:00
|
|
|
extern crate vhost_user_block;
|
2019-10-23 14:36:01 +00:00
|
|
|
|
2023-09-21 15:35:44 +00:00
|
|
|
use clap::{Arg, Command};
|
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() {
|
2021-08-04 19:35:56 +00:00
|
|
|
env_logger::init();
|
|
|
|
|
2023-09-21 15:35:44 +00:00
|
|
|
let cmd_arguments = Command::new("vhost-user-blk backend")
|
|
|
|
.version(env!("CARGO_PKG_VERSION"))
|
|
|
|
.author(env!("CARGO_PKG_AUTHORS"))
|
|
|
|
.about("Launch a vhost-user-blk backend.")
|
2024-02-23 22:38:12 +00:00
|
|
|
.arg_required_else_help(true)
|
2023-09-21 15:35:44 +00:00
|
|
|
.arg(
|
|
|
|
Arg::new("block-backend")
|
|
|
|
.long("block-backend")
|
|
|
|
.help(vhost_user_block::SYNTAX)
|
|
|
|
.num_args(1)
|
|
|
|
.required(true),
|
|
|
|
)
|
|
|
|
.get_matches();
|
|
|
|
|
|
|
|
let backend_command = cmd_arguments.get_one::<String>("block-backend").unwrap();
|
|
|
|
start_block_backend(backend_command);
|
2019-10-23 14:36:01 +00:00
|
|
|
}
|