* [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] Re: [PATCH] add --accel option
2009-07-28 20:26 [Qemu-devel] [PATCH] add --accel option Glauber Costa
@ 2009-07-28 20:27 ` Anthony Liguori
2009-07-28 20:40 ` Glauber Costa
0 siblings, 1 reply; 4+ messages in thread
From: Anthony Liguori @ 2009-07-28 20:27 UTC (permalink / raw)
To: Glauber Costa; +Cc: qemu-devel
Glauber Costa wrote:
> 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>
>
To be useful, it should also include kqemu and a none option.
--
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] Re: [PATCH] add --accel option
2009-07-28 20:27 ` [Qemu-devel] " Anthony Liguori
@ 2009-07-28 20:40 ` Glauber Costa
0 siblings, 0 replies; 4+ messages in thread
From: Glauber Costa @ 2009-07-28 20:40 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel
On Tue, Jul 28, 2009 at 03:27:19PM -0500, Anthony Liguori wrote:
> Glauber Costa wrote:
>> 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>
>>
>
> To be useful, it should also include kqemu and a none option.
yeah, agree. This can be added later (even now!). I just wanted to signal it
out that it will happen, because it will allow us to change qemu-kvm semantics in a
positive way. I can redo the patch or send an incremental, whatever you prefer
^ permalink raw reply [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
* Re: [Qemu-devel] [PATCH] add --accel option
2009-07-28 20:48 [Qemu-devel] " Glauber Costa
@ 2009-07-29 8:16 ` Kevin Wolf
2009-07-29 15:46 ` Glauber Costa
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Wolf @ 2009-07-29 8:16 UTC (permalink / raw)
To: Glauber Costa; +Cc: aliguori, qemu-devel
Glauber Costa schrieb:
> 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.
The documentation should include which values are valid for the option.
Guessing that the syntax is -accel kvm is probably possible, but for
-accel kqemu,mode=kernel it's definitely hard.
Kevin
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] add --accel option
2009-07-29 8:16 ` Kevin Wolf
@ 2009-07-29 15:46 ` Glauber Costa
[not found] ` <m363db5vzj.fsf@neno.mitica>
0 siblings, 1 reply; 4+ messages in thread
From: Glauber Costa @ 2009-07-29 15:46 UTC (permalink / raw)
To: Kevin Wolf; +Cc: aliguori, qemu-devel
On Wed, Jul 29, 2009 at 10:16:28AM +0200, Kevin Wolf wrote:
> Glauber Costa schrieb:
> > 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.
>
> The documentation should include which values are valid for the option.
> Guessing that the syntax is -accel kvm is probably possible, but for
> -accel kqemu,mode=kernel it's definitely hard.
right now kqemu needs an extra argument.
But very soon kvm will need it too. Like for example controlling knobs
like kvm-irqchip and kvm-pit. So maybe we want a standard way of passing
arguments for all accels?
How about --accel foo,args=bar,bar,bar with the args part being optional ?
An exampel would be --accel kvm,args=userpit,userirqchip (assuming we want the
default to be in the kernel)
Otherwise we're stuck with an evergrowing combination to support
^ permalink raw reply [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).