Add KVM support
Change-Id: I71c4901a25f88e4962bcab3e3299cfe69b1e2a5c
diff --git a/src/device.rs b/src/device.rs
index 98ca071..d5a4906 100644
--- a/src/device.rs
+++ b/src/device.rs
@@ -224,6 +224,7 @@
pub struct StartEmulatorOptions {
pub verbose: bool,
pub with_graphics: bool,
+ pub with_kvm: bool,
pub with_networking: bool,
pub disable_virtcon: bool,
}
@@ -238,6 +239,9 @@
if options.with_graphics {
args.push("-g");
}
+ if options.with_kvm {
+ args.push("-k");
+ }
if options.disable_virtcon {
args.push("-c");
diff --git a/src/lib.rs b/src/lib.rs
index 88a9359..25547d4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -720,6 +720,7 @@
static START: &str = "start";
static RESTART: &str = "restart";
static GRAPHICS: &str = "graphics";
+static KVM: &str = "kvm";
static DISABLE_VIRTCON: &str = "disable-virtcon";
static WRITE_CONFIG: &str = "write-config";
@@ -738,6 +739,7 @@
fn emulator_args() -> Vec<Arg<'static, 'static>> {
vec![
Arg::with_name(GRAPHICS).short("g").help("Start a simulator with graphics enabled"),
+ Arg::with_name(KVM).short("k").help("Start a simulator with KVM (Linux only)"),
Arg::with_name(DISABLE_VIRTCON)
.long(DISABLE_VIRTCON)
.help("Do not launch the virtual console service if this option is present"),
@@ -1341,6 +1343,7 @@
&StartEmulatorOptions {
verbose: verbose,
with_graphics: start_matches.is_present(GRAPHICS),
+ with_kvm: start_matches.is_present(KVM),
with_networking: !start_matches.is_present(NO_NET),
disable_virtcon: start_matches.is_present(DISABLE_VIRTCON),
},
@@ -1366,6 +1369,7 @@
&StartEmulatorOptions {
verbose: verbose,
with_graphics: restart_matches.is_present(GRAPHICS),
+ with_kvm: restart_matches.is_present(KVM),
with_networking: !restart_matches.is_present(NO_NET),
disable_virtcon: restart_matches.is_present(DISABLE_VIRTCON),
},