Patchwork [v12,7/8] allower the user to disable pv event support

login
register
mail settings
Submitter Hu Tao
Date Dec. 12, 2012, 6:13 a.m.
Message ID <214177b6e6e6734269dd1fd50a710d68ce8b37e1.1355290850.git.hutao@cn.fujitsu.com>
Download mbox | patch
Permalink /patch/205438/
State New
Headers show

Comments

Hu Tao - Dec. 12, 2012, 6:13 a.m.
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
---
 hw/pc_piix.c    | 8 +++++++-
 qemu-config.c   | 4 ++++
 qemu-options.hx | 3 ++-
 3 files changed, 13 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 8380702..bf31b96 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -150,6 +150,8 @@  static void pc_init1(MemoryRegion *system_memory,
     MemoryRegion *pci_memory;
     MemoryRegion *rom_memory;
     void *fw_cfg = NULL;
+    QemuOptsList *list = qemu_find_opts("machine");
+    bool enable_pv_event = false;
 
     pc_cpus_init(cpu_model);
 
@@ -288,7 +290,11 @@  static void pc_init1(MemoryRegion *system_memory,
         pc_pci_device_init(pci_bus);
     }
 
-    if (kvm_enabled()) {
+    if (list && !QTAILQ_EMPTY(&list->head)) {
+        enable_pv_event = qemu_opt_get_bool(QTAILQ_FIRST(&list->head),
+                                            "enable_pv_event", false);
+    }
+    if (kvm_enabled() && enable_pv_event) {
         kvm_pv_event_init(isa_bus);
     }
 }
diff --git a/qemu-config.c b/qemu-config.c
index 10d1ba4..6682276 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -627,6 +627,10 @@  static QemuOptsList qemu_machine_opts = {
             .name = "usb",
             .type = QEMU_OPT_BOOL,
             .help = "Set on/off to enable/disable usb",
+        }, {
+            .name = "enable_pv_event",
+            .type = QEMU_OPT_BOOL,
+            .help = "handle pv event"
         },
         { /* End of list */ }
     },
diff --git a/qemu-options.hx b/qemu-options.hx
index dd86bfe..44c7760 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -35,7 +35,8 @@  DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
     "                kernel_irqchip=on|off controls accelerated irqchip support\n"
     "                kvm_shadow_mem=size of KVM shadow MMU\n"
     "                dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
-    "                mem-merge=on|off controls memory merge support (default: on)\n",
+    "                mem-merge=on|off controls memory merge support (default: on)\n"
+    "                enable_pv_event=on|off controls pv event support (default: off)\n",
     QEMU_ARCH_ALL)
 STEXI
 @item -machine [type=]@var{name}[,prop=@var{value}[,...]]