xref: /cloud-hypervisor/vhost_user_block/src/main.rs (revision 3ce0fef7fd546467398c914dbc74d8542e45cf6f)
1 // Copyright 2019 Red Hat, Inc. All Rights Reserved.
2 //
3 // Portions Copyright 2019 Intel Corporation. All Rights Reserved.
4 //
5 // Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
6 //
7 // Portions Copyright 2017 The Chromium OS Authors. All rights reserved.
8 //
9 // SPDX-License-Identifier: (Apache-2.0 AND BSD-3-Clause)
10 
11 extern crate vhost_user_block;
12 
13 use clap::{Arg, Command};
14 use vhost_user_block::start_block_backend;
15 
16 fn main() {
17     env_logger::init();
18 
19     let cmd_arguments = Command::new("vhost-user-blk backend")
20         .version(env!("CARGO_PKG_VERSION"))
21         .author(env!("CARGO_PKG_AUTHORS"))
22         .about("Launch a vhost-user-blk backend.")
23         .arg(
24             Arg::new("block-backend")
25                 .long("block-backend")
26                 .help(vhost_user_block::SYNTAX)
27                 .num_args(1)
28                 .required(true),
29         )
30         .get_matches();
31 
32     let backend_command = cmd_arguments.get_one::<String>("block-backend").unwrap();
33     start_block_backend(backend_command);
34 }
35