mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Add new flag "--vsock"
The new flag vsock is meant to be used in order to create a VM with a virtio-vsock device attached to it. Two parameters are needed with this device, "cid" representing the guest context ID, and "sock" representing the UNIX socket path which can be accessed from the host. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -165,6 +165,16 @@ fn main() {
|
||||
.takes_value(true)
|
||||
.min_values(1),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("vsock")
|
||||
.long("vsock")
|
||||
.help(
|
||||
"Virtio VSOCK parameters \"cid=<context_id>,\
|
||||
sock=<socket_path>\"",
|
||||
)
|
||||
.takes_value(true)
|
||||
.min_values(1),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("v")
|
||||
.short("v")
|
||||
@@ -200,6 +210,7 @@ fn main() {
|
||||
let vhost_user_net: Option<Vec<&str>> = cmd_arguments
|
||||
.values_of("vhost-user-net")
|
||||
.map(|x| x.collect());
|
||||
let vsock: Option<Vec<&str>> = cmd_arguments.values_of("vsock").map(|x| x.collect());
|
||||
|
||||
let log_level = match cmd_arguments.occurrences_of("v") {
|
||||
0 => LevelFilter::Error,
|
||||
@@ -239,6 +250,7 @@ fn main() {
|
||||
console,
|
||||
devices,
|
||||
vhost_user_net,
|
||||
vsock,
|
||||
}) {
|
||||
Ok(config) => config,
|
||||
Err(e) => {
|
||||
|
||||
Reference in New Issue
Block a user