qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Glauber Costa <glommer@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com
Subject: [Qemu-devel] [PATCH] add --accel option
Date: Tue, 28 Jul 2009 16:48:01 -0400	[thread overview]
Message-ID: <1248814081-7860-1-git-send-email-glommer@redhat.com> (raw)

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 <glommer@redhat.com>
---
 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

             reply	other threads:[~2009-07-28 20:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-28 20:48 Glauber Costa [this message]
2009-07-28 22:25 ` [Qemu-devel] [PATCH] add --accel option Filip Navara
2009-07-29  8:16 ` Kevin Wolf
2009-07-29 15:46   ` Glauber Costa
2009-07-29 15:46     ` Kevin Wolf
     [not found]     ` <m363db5vzj.fsf@neno.mitica>
2009-07-29 15:56       ` [Qemu-devel] " Kevin Wolf
2009-07-29 18:52 ` [Qemu-devel] " Paul Brook
2009-07-29 19:04   ` Anthony Liguori
  -- strict thread matches above, loose matches on Subject: below --
2009-07-28 20:26 Glauber Costa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1248814081-7860-1-git-send-email-glommer@redhat.com \
    --to=glommer@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).