@@ -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
{
@@ -20,6 +20,7 @@
#ifdef CONFIG_KVM
extern int kvm_allowed;
+extern int kvm_use_kernel_chip;
#define kvm_enabled() (kvm_allowed)
#else
@@ -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,
};
@@ -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);
@@ -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
@@ -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;