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 #[macro_use(crate_version, crate_authors)] 12 extern crate clap; 13 extern crate vhost_user_block; 14 15 use clap::{Arg, Command}; 16 use vhost_user_block::start_block_backend; 17 18 fn main() { 19 env_logger::init(); 20 21 let cmd_arguments = Command::new("vhost-user-blk backend") 22 .version(crate_version!()) 23 .author(crate_authors!()) 24 .about("Launch a vhost-user-blk backend.") 25 .arg( 26 Arg::new("block-backend") 27 .long("block-backend") 28 .help(vhost_user_block::SYNTAX) 29 .takes_value(true) 30 .required(true), 31 ) 32 .get_matches(); 33 34 let backend_command = cmd_arguments.value_of("block-backend").unwrap(); 35 start_block_backend(backend_command); 36 } 37