main: Simplify error and return handling in start_vmm

Use a Result<> type with an error to simplify the code in start_vmm().
This will also make it easier to add cleanup funtionality.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2020-10-26 16:16:56 +00:00
parent dfd21cbfc5
commit c22b788b47
3 changed files with 51 additions and 55 deletions
+2
View File
@@ -13,6 +13,7 @@ homepage = "https://github.com/cloud-hypervisor/cloud-hypervisor"
lto = true
[dependencies]
anyhow = "1.0"
api_client = { path = "api_client" }
clap = { version = "2.33.3", features = ["wrap_help"] }
hypervisor = { path = "hypervisor" }
@@ -21,6 +22,7 @@ log = { version = "0.4.11", features = ["std"] }
option_parser = { path = "option_parser" }
seccomp = { git = "https://github.com/firecracker-microvm/firecracker", tag = "v0.22.0" }
serde_json = "1.0.59"
thiserror = "1.0"
vhost_user_block = { path = "vhost_user_block"}
vhost_user_net = { path = "vhost_user_net"}
vmm = { path = "vmm" }