cloud-hypervisor/vhost_user_net/src/main.rs
Alyssa Ross b2cc45e0a3 vhost_user_*: set up logging
These crates are written to produce log messages using the error!
macro, but their logs didn't actually go anywhere, which made it very
difficult to debug when they're not working.

I've used env_logger here because it's the same log implementation
that the hypervisor crate uses.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
2021-08-05 09:24:32 +02:00

34 lines
982 B
Rust

// 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;
use clap::{App, Arg};
use vhost_user_net::start_net_backend;
fn main() {
env_logger::init();
let cmd_arguments = App::new("vhost-user-net backend")
.version(crate_version!())
.author(crate_authors!())
.about("Launch a vhost-user-net backend.")
.arg(
Arg::with_name("net-backend")
.long("net-backend")
.help(vhost_user_net::SYNTAX)
.takes_value(true)
.required(true),
)
.get_matches();
let backend_command = cmd_arguments.value_of("net-backend").unwrap();
start_net_backend(backend_command);
}