vhost_user_net, vhost_user_block, option_parser: Remove vmm dependency

Remove the vmm dependency from vhost_user_block and vhost_user_net where
it was existing to use config::OptionParser. By moving the OptionParser
to its own crate at the top-level we can remove the very heavy
dependency that these vhost-user backends had.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2020-07-06 16:41:45 +01:00
parent 90261bb9c7
commit b69f6d4f6c
11 changed files with 192 additions and 172 deletions

View File

@@ -11,11 +11,11 @@ extern crate net_util;
extern crate vhost_rs;
extern crate vhost_user_backend;
extern crate virtio_devices;
extern crate vmm;
use libc::{self, EFD_NONBLOCK};
use log::*;
use net_util::{MacAddr, Tap};
use option_parser::{OptionParser, OptionParserError};
use std::fmt;
use std::io::{self};
use std::net::Ipv4Addr;
@@ -31,7 +31,6 @@ use virtio_bindings::bindings::virtio_ring::VIRTIO_RING_F_EVENT_IDX;
use virtio_devices::net_util::{open_tap, RxVirtio, TxVirtio};
use virtio_devices::{NetCounters, NetQueuePair};
use vm_memory::{GuestMemoryAtomic, GuestMemoryMmap};
use vmm::config::{OptionParser, OptionParserError};
use vmm_sys_util::eventfd::EventFd;
pub type VhostUserResult<T> = std::result::Result<T, VhostUserError>;