From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MVtaj-00059v-LC for qemu-devel@nongnu.org; Tue, 28 Jul 2009 16:48:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MVtae-00058P-8o for qemu-devel@nongnu.org; Tue, 28 Jul 2009 16:48:08 -0400 Received: from [199.232.76.173] (port=36741 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVtae-00058M-3W for qemu-devel@nongnu.org; Tue, 28 Jul 2009 16:48:04 -0400 Received: from mx2.redhat.com ([66.187.237.31]:47021) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MVtad-0002c6-FO for qemu-devel@nongnu.org; Tue, 28 Jul 2009 16:48:03 -0400 From: Glauber Costa Date: Tue, 28 Jul 2009 16:48:01 -0400 Message-Id: <1248814081-7860-1-git-send-email-glommer@redhat.com> Subject: [Qemu-devel] [PATCH] add --accel option List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com 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 --- 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 +@item -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