config: Reorganize command line parsing

The command line parsing of the user input was not properly
abstracted from the vmm specific code. In the case of --net,
the parsing was done when the device manager was adding devices.

In order to fix this confusion, this patch introduces a new
module "config" dedicated to the translation of a VmParams
structure into a VmCfg structure. The former is built based
on the input provided by the user, while the latter is the
result of the parsing of every options.

VmCfg is meant to be consumed by the vmm specific code, and
it is also a fully public structure so that it can directly
be built from a testing environment.

Fixes #31

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Sebastien Boeuf
2019-05-23 12:48:05 -07:00
committed by Rob Bradford
parent 9900daacf8
commit e5e651895b
4 changed files with 317 additions and 196 deletions
+3 -1
View File
@@ -11,9 +11,11 @@ use kvm_ioctls::*;
use std::fmt::{self, Display};
use std::result;
pub mod config;
pub mod vm;
use self::vm::{Vm, VmConfig};
use self::config::VmConfig;
use self::vm::Vm;
/// Errors associated with VM management
#[derive(Debug)]