All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glauber Costa <glommer@redhat.com>
To: kvm@vger.kernel.org
Cc: mtosatti@redhat.com
Subject: [PATCH 08/10] Add -kvm option
Date: Fri, 26 Feb 2010 17:12:19 -0300	[thread overview]
Message-ID: <1267215141-13629-9-git-send-email-glommer@redhat.com> (raw)
In-Reply-To: <1267215141-13629-8-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 |   11 +++++++++--
 vl.c            |   11 +++++++++++
 6 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index 00e7411..0527e0f 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -52,6 +52,7 @@ typedef struct KVMSlot
 typedef struct kvm_dirty_log KVMDirtyLog;
 
 int kvm_allowed = 0;
+int kvm_use_kernel_chip = 1;
 
 struct KVMState
 {
diff --git a/kvm.h b/kvm.h
index 7278874..480e651 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 246fae6..310838e 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -290,6 +290,21 @@ QemuOptsList qemu_cpudef_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,
@@ -300,6 +315,7 @@ static QemuOptsList *lists[] = {
     &qemu_global_opts,
     &qemu_mon_opts,
     &qemu_cpudef_opts,
+    &qemu_kvm_opts,
     NULL,
 };
 
diff --git a/qemu-config.h b/qemu-config.h
index b335c42..506e5fb 100644
--- a/qemu-config.h
+++ b/qemu-config.h
@@ -10,6 +10,7 @@ extern QemuOptsList qemu_rtc_opts;
 extern QemuOptsList qemu_global_opts;
 extern QemuOptsList qemu_mon_opts;
 extern QemuOptsList qemu_cpudef_opts;
+extern QemuOptsList qemu_kvm_opts;
 
 int qemu_set_option(const char *str);
 int qemu_global_option(const char *str);
diff --git a/qemu-options.hx b/qemu-options.hx
index 3f49b44..f8fd86d 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1793,10 +1793,17 @@ 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")
+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")
+
 #endif
 STEXI
+@item -kvm enable=[on|off][,irqchip-in-kernel=on|off]
+@findex -kvm
 @item -enable-kvm
 @findex -enable-kvm
 Enable KVM full virtualization support. This option is only available
diff --git a/vl.c b/vl.c
index 66e477a..8c94fee 100644
--- a/vl.c
+++ b/vl.c
@@ -5416,6 +5416,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.6


  reply	other threads:[~2010-02-26 20:12 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-26 20:12 [PATCH 00/10] uq/master: irqchip-in-kernel support Glauber Costa
2010-02-26 20:12 ` [PATCH 01/10] introduce VMSTATE_U64 Glauber Costa
2010-02-26 20:12   ` [PATCH 02/10] Provide ioapic-kvm Glauber Costa
2010-02-26 20:12     ` [PATCH 03/10] provide apic_set_irq_delivered Glauber Costa
2010-02-26 20:12       ` [PATCH 04/10] provide i8259-kvm Glauber Costa
2010-02-26 20:12         ` [PATCH 05/10] Don't call apic functions directly from kvm code Glauber Costa
2010-02-26 20:12           ` [PATCH 06/10] export kvm_put_mp_state Glauber Costa
2010-02-26 20:12             ` [PATCH 07/10] provide apic-kvm Glauber Costa
2010-02-26 20:12               ` Glauber Costa [this message]
2010-02-26 20:12                 ` [PATCH 09/10] Initialize in-kernel irqchip Glauber Costa
2010-02-26 20:12                   ` [PATCH 10/10] Do GSI routing Glauber Costa
2010-03-02  4:31                   ` [PATCH 09/10] Initialize in-kernel irqchip Marcelo Tosatti
2010-03-02 18:25                     ` Glauber Costa
2010-03-09 13:21                       ` Avi Kivity
2010-02-27 10:35                 ` [PATCH 08/10] Add -kvm option Jan Kiszka
2010-03-04 16:20                   ` Jan Kiszka
2010-03-04 19:39                     ` Glauber Costa
2010-03-02  4:31                 ` Marcelo Tosatti
2010-03-02 18:25                   ` Glauber Costa
2010-03-04 19:41                     ` Anthony Liguori
2010-03-04 19:38                 ` Anthony Liguori
2010-03-04 16:49               ` [PATCH 07/10] provide apic-kvm Jan Kiszka
2010-03-09 13:27           ` [PATCH 05/10] Don't call apic functions directly from kvm code Avi Kivity
2010-03-17 14:00             ` Glauber Costa
2010-03-17 16:29               ` Avi Kivity
2010-03-02  4:28     ` [PATCH 02/10] Provide ioapic-kvm Marcelo Tosatti
2010-03-02 18:26       ` Glauber Costa
2010-02-27 10:28 ` [PATCH 00/10] uq/master: irqchip-in-kernel support Jan Kiszka
2010-03-01 15:19   ` Marcelo Tosatti
2010-03-04 16:33 ` Jan Kiszka
2010-03-08 20:56   ` Marcelo Tosatti

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=1267215141-13629-9-git-send-email-glommer@redhat.com \
    --to=glommer@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.