From: Glauber Costa <glommer@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com
Subject: [Qemu-devel] [PATCH v2 9/9] Add -kvm option
Date: Wed, 7 Oct 2009 19:08:35 -0300 [thread overview]
Message-ID: <1254953315-5761-10-git-send-email-glommer@redhat.com> (raw)
In-Reply-To: <1254953315-5761-9-git-send-email-glommer@redhat.com>
This option deprecates --enable-kvm. It is a more flexible option,
that makes use of qemu-opts, and allow us to pass on options to enable or
disable kernel irqchip, for example.
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
kvm-all.c | 1 +
kvm.h | 1 +
qemu-config.c | 16 ++++++++++++++++
qemu-config.h | 1 +
qemu-options.hx | 13 +++++++++----
vl.c | 11 +++++++++++
6 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index f33354d..b31d085 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -51,6 +51,7 @@ typedef struct KVMSlot
typedef struct kvm_dirty_log KVMDirtyLog;
int kvm_allowed = 0;
+int kvm_use_kernel_chip = 0;
struct KVMState
{
diff --git a/kvm.h b/kvm.h
index f0c9201..49a2b56 100644
--- a/kvm.h
+++ b/kvm.h
@@ -20,6 +20,7 @@
#ifdef CONFIG_KVM
extern int kvm_allowed;
+extern int kvm_use_kernel_chip;
#define kvm_enabled() (kvm_allowed)
#else
diff --git a/qemu-config.c b/qemu-config.c
index bafaea2..9461766 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -184,12 +184,28 @@ QemuOptsList qemu_rtc_opts = {
},
};
+QemuOptsList qemu_kvm_opts = {
+ .name = "kvm",
+ .head = QTAILQ_HEAD_INITIALIZER(qemu_kvm_opts.head),
+ .desc = {
+ {
+ .name = "irqchip-in-kernel",
+ .type = QEMU_OPT_BOOL,
+ },{
+ .name = "enabled",
+ .type = QEMU_OPT_BOOL,
+ },
+ { /* end if list */ }
+ },
+};
+
static QemuOptsList *lists[] = {
&qemu_drive_opts,
&qemu_chardev_opts,
&qemu_device_opts,
&qemu_net_opts,
&qemu_rtc_opts,
+ &qemu_kvm_opts,
NULL,
};
diff --git a/qemu-config.h b/qemu-config.h
index cdad5ac..58cead2 100644
--- a/qemu-config.h
+++ b/qemu-config.h
@@ -6,6 +6,7 @@ extern QemuOptsList qemu_chardev_opts;
extern QemuOptsList qemu_device_opts;
extern QemuOptsList qemu_net_opts;
extern QemuOptsList qemu_rtc_opts;
+extern QemuOptsList qemu_kvm_opts;
int qemu_set_option(const char *str);
diff --git a/qemu-options.hx b/qemu-options.hx
index 3dd76b3..1cb8431 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1431,15 +1431,20 @@ Set the filename for the BIOS.
ETEXI
#ifdef CONFIG_KVM
-DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
- "-enable-kvm enable KVM full virtualization support\n")
-#endif
+HXCOMM Options deprecated by -kvm
+DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, "")
+
+DEF("kvm", HAS_ARG, QEMU_OPTION_kvm, \
+ "-kvm enable=on|off,irqchip-in-kernel=on|off\n" \
+ " enable KVM full virtualization support\n")
STEXI
-@item -enable-kvm
+@item -kvm [enable=on|off][,irqchip-in-kernel=on|off]
Enable KVM full virtualization support. This option is only available
if KVM support is enabled when compiling.
ETEXI
+#endif
+
#ifdef CONFIG_XEN
DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid,
"-xen-domid id specify xen guest domain id\n")
diff --git a/vl.c b/vl.c
index afe01af..a6f9eb7 100644
--- a/vl.c
+++ b/vl.c
@@ -5353,6 +5353,17 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_enable_kvm:
kvm_allowed = 1;
break;
+ case QEMU_OPTION_kvm:
+
+ opts = qemu_opts_parse(&qemu_kvm_opts, optarg, NULL);
+ if (!opts) {
+ fprintf(stderr, "parse error: %s\n", optarg);
+ exit(1);
+ }
+
+ kvm_allowed = qemu_opt_get_bool(opts, "enabled", 1);
+ kvm_use_kernel_chip = qemu_opt_get_bool(opts, "irqchip-in-kernel", 1);
+ break;
#endif
case QEMU_OPTION_usb:
usb_enabled = 1;
--
1.6.2.5
next prev parent reply other threads:[~2009-10-07 22:09 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-07 22:08 [Qemu-devel] [PATCH v2] Add in-kernel irqchip Glauber Costa
2009-10-07 22:08 ` [Qemu-devel] [PATCH v2 1/9] add base-addr field to io apic state Glauber Costa
2009-10-07 22:08 ` [Qemu-devel] [PATCH v2 2/9] Save missing fields in VMState Glauber Costa
2009-10-07 22:08 ` [Qemu-devel] [PATCH v2 3/9] provide in-kernel ioapic Glauber Costa
2009-10-07 22:08 ` [Qemu-devel] [PATCH v2 4/9] provide in-kernel apic Glauber Costa
2009-10-07 22:08 ` [Qemu-devel] [PATCH v2 5/9] provide apic_set_irq_delivered Glauber Costa
2009-10-07 22:08 ` [Qemu-devel] [PATCH v2 6/9] provide in-kernel i8259 chip Glauber Costa
2009-10-07 22:08 ` [Qemu-devel] [PATCH v2 7/9] initialize " Glauber Costa
2009-10-07 22:08 ` [Qemu-devel] [PATCH v2 8/9] Initialize in-kernel irqchip Glauber Costa
2009-10-07 22:08 ` Glauber Costa [this message]
2009-10-07 23:00 ` [Qemu-devel] Re: [PATCH v2 9/9] Add -kvm option Anthony Liguori
2009-10-07 23:14 ` Glauber Costa
2009-10-07 23:28 ` Anthony Liguori
2009-10-12 11:58 ` Gerd Hoffmann
2009-10-12 14:04 ` Anthony Liguori
2009-10-12 15:34 ` Gerd Hoffmann
2009-10-12 16:31 ` Anthony Liguori
2009-10-13 8:05 ` Gerd Hoffmann
2009-10-13 15:33 ` Anthony Liguori
2009-10-13 19:26 ` Markus Armbruster
2009-10-13 20:43 ` Anthony Liguori
2009-10-14 8:08 ` Gerd Hoffmann
2009-10-13 15:36 ` Anthony Liguori
2009-10-13 22:57 ` Jamie Lokier
2009-10-08 14:07 ` Avi Kivity
2009-10-08 14:23 ` Anthony Liguori
2009-10-08 14:30 ` Avi Kivity
2009-10-08 14:33 ` Anthony Liguori
2009-10-08 14:41 ` Avi Kivity
2009-10-08 14:56 ` Anthony Liguori
2009-10-08 15:05 ` Avi Kivity
2009-10-08 15:14 ` Anthony Liguori
2009-10-12 11:15 ` Gerd Hoffmann
2009-10-08 14:34 ` Gleb Natapov
2009-10-08 12:02 ` [Qemu-devel] Re: [PATCH v2 7/9] initialize i8259 chip Jan Kiszka
2009-10-08 13:55 ` [Qemu-devel] Re: [PATCH v2 4/9] provide in-kernel apic Anthony Liguori
2009-10-08 14:09 ` Avi Kivity
2009-10-08 14:22 ` Glauber Costa
2009-10-09 10:06 ` Jamie Lokier
2009-10-09 14:30 ` Glauber Costa
2009-10-09 16:48 ` Jamie Lokier
2009-10-09 18:06 ` Glauber Costa
2009-10-09 19:49 ` Anthony Liguori
2009-10-11 9:10 ` Avi Kivity
2009-10-12 13:41 ` Anthony Liguori
2009-10-08 14:26 ` Anthony Liguori
2009-10-08 14:31 ` Avi Kivity
2009-10-08 14:39 ` Anthony Liguori
2009-10-08 14:46 ` Glauber Costa
2009-10-08 14:44 ` Glauber Costa
2009-10-08 11:46 ` [Qemu-devel] Re: [PATCH v2 3/9] provide in-kernel ioapic Jan Kiszka
2009-10-08 13:49 ` Anthony Liguori
2009-10-08 13:54 ` Avi Kivity
2009-10-08 15:53 ` Jan Kiszka
2009-10-08 16:07 ` Jamie Lokier
2009-10-08 16:12 ` Anthony Liguori
2009-10-08 16:17 ` Avi Kivity
2009-10-08 16:22 ` Gleb Natapov
2009-10-08 16:29 ` Avi Kivity
2009-10-08 16:34 ` Gleb Natapov
2009-10-08 16:42 ` Avi Kivity
2009-10-08 17:11 ` Gleb Natapov
2009-10-09 10:02 ` Jamie Lokier
2009-10-09 12:02 ` Gleb Natapov
2009-10-09 14:32 ` Glauber Costa
2009-10-09 16:49 ` Jamie Lokier
[not found] ` <m31vlctk9q.fsf@neno.mitica>
2009-10-09 21:34 ` Glauber Costa
2009-10-12 13:20 ` Anthony Liguori
2009-10-12 14:18 ` Jamie Lokier
2009-10-12 14:49 ` Anthony Liguori
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=1254953315-5761-10-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).