vmm: Add virtio-fs support to the VMM

The user can now share some files and directories with the guest by
providing the corresponding vhost-user socket. The virtiofsd daemon
should be started by the user before to start the VM.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2019-05-22 13:06:49 -07:00
committed by Samuel Ortiz
parent 1ddc8f2f0d
commit 2ede30b6d3
3 changed files with 150 additions and 17 deletions

View File

@@ -63,6 +63,16 @@ fn main() {
.help("Path to entropy source")
.default_value(config::DEFAULT_RNG_SOURCE),
)
.arg(
Arg::with_name("fs")
.long("fs")
.help(
"virtio-fs parameters \"tag=<tag_name>,\
sock=<socket_path>,num_queues=<number_of_queues>,\
queue_size=<size_of_each_queue>\"",
)
.takes_value(true),
)
.get_matches();
// These .unwrap()s cannot fail as there is a default value defined
@@ -85,14 +95,17 @@ fn main() {
// This .unwrap() cannot fail as there is a default value defined
let rng = cmd_arguments.value_of("rng").unwrap();
let fs = cmd_arguments.value_of("fs");
let vm_config = match config::VmConfig::parse(config::VmParams {
cpus,
memory,
kernel,
cmdline,
disks,
rng,
net,
rng,
fs,
}) {
Ok(config) => config,
Err(e) => {