[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] add --accel option
From: |
Glauber Costa |
Subject: |
[Qemu-devel] [PATCH] add --accel option |
Date: |
Tue, 28 Jul 2009 16:48:01 -0400 |
Since libvirt dudes seem to prefer it, add a --accel option. For now,
it only does the same as --enable-kvm, but it can easily be extended
in the future. It also accepts "none" and "kqemu" options.
Signed-off-by: Glauber Costa <address@hidden>
---
qemu-options.hx | 7 +++++++
vl.c | 26 +++++++++++++++++++++++++-
2 files changed, 32 insertions(+), 1 deletions(-)
diff --git a/qemu-options.hx b/qemu-options.hx
index 1b420a3..990513f 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1429,6 +1429,13 @@ Enable KQEMU kernel module usage. KQEMU options are only
available if
KQEMU support is enabled when compiling.
ETEXI
+DEF("accel", HAS_ARG, QEMU_OPTION_accel, \
+ "-accel name enable a given accelerator module\n")
+STEXI
address@hidden -accel @var{name}
+Enable a given accelerator module, for instance, KVM.
+ETEXI
+
#ifdef CONFIG_KVM
DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
"-enable-kvm enable KVM full virtualization support\n")
diff --git a/vl.c b/vl.c
index bb56644..5728715 100644
--- a/vl.c
+++ b/vl.c
@@ -3091,7 +3091,6 @@ static int ram_save_live(QEMUFile *f, int stage, void
*opaque)
while (ram_save_block(f) != 0) {
bytes_transferred += TARGET_PAGE_SIZE;
}
- cpu_physical_memory_set_dirty_tracking(0);
}
qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
@@ -5431,6 +5430,31 @@ int main(int argc, char **argv, char **envp)
kqemu_allowed = 2;
break;
#endif
+ case QEMU_OPTION_accel:
+ {
+ const char *kqemu_opt;
+ if (strstart(optarg, "kvm", NULL)) {
+ kvm_allowed = 1;
+ kqemu_allowed = 0;
+ }
+ if (strstart(optarg, "none", NULL)) {
+ kvm_allowed = 0;
+ kqemu_allowed = 0;
+ }
+
+ if (strstart(optarg, "kqemu", &kqemu_opt)) {
+ kvm_allowed = 0;
+ if (*kqemu_opt == ',' &&
strstart(kqemu_opt,",mode=kernel", NULL)) {
+ kqemu_allowed = 2;
+ } else if (*kqemu_opt != ',' || strstart(kqemu_opt,
",mode=user", NULL)) {
+ kqemu_allowed = 1;
+ } else {
+ fprintf(stderr, "invalid kqemu mode. use mode=user or
mode=kernel\n");
+ exit(1);
+ }
+ }
+ break;
+ }
#ifdef CONFIG_KVM
case QEMU_OPTION_enable_kvm:
kvm_allowed = 1;
--
1.6.2.2