qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] add --accel option
@ 2009-07-28 20:26 Glauber Costa
  2009-07-28 20:27 ` [Qemu-devel] " Anthony Liguori
  0 siblings, 1 reply; 4+ messages in thread
From: Glauber Costa @ 2009-07-28 20:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori

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.

Signed-off-by: Glauber Costa <glommer@redhat.com>
---
 qemu-options.hx |    7 +++++++
 vl.c            |    7 ++++++-
 2 files changed, 13 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..e03f3af 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,12 @@ int main(int argc, char **argv, char **envp)
                 kqemu_allowed = 2;
                 break;
 #endif
+            case QEMU_OPTION_accel:
+                if (strstart(optarg, "kvm", NULL)) {
+                    kvm_allowed = 1;
+                    kqemu_allowed = 0;
+                }
+                break;
 #ifdef CONFIG_KVM
             case QEMU_OPTION_enable_kvm:
                 kvm_allowed = 1;
-- 
1.6.2.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH] add --accel option
@ 2009-07-28 20:48 Glauber Costa
  2009-07-29  8:16 ` Kevin Wolf
  0 siblings, 1 reply; 4+ messages in thread
From: Glauber Costa @ 2009-07-28 20:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-29 15:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-28 20:26 [Qemu-devel] [PATCH] add --accel option Glauber Costa
2009-07-28 20:27 ` [Qemu-devel] " Anthony Liguori
2009-07-28 20:40   ` Glauber Costa
  -- strict thread matches above, loose matches on Subject: below --
2009-07-28 20:48 [Qemu-devel] " Glauber Costa
2009-07-29  8:16 ` Kevin Wolf
2009-07-29 15:46   ` Glauber Costa
     [not found]     ` <m363db5vzj.fsf@neno.mitica>
2009-07-29 15:56       ` [Qemu-devel] " Kevin Wolf

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).