qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 8/8] kvm: Rework VCPU reset


From: Jan Kiszka
Subject: [Qemu-devel] [PATCH 8/8] kvm: Rework VCPU reset
Date: Fri, 01 May 2009 23:17:21 +0200
User-agent: StGIT/0.14.2

Use standard callback with highest order to synchronize VCPU on reset
after all device callbacks were execute. This allows to remove the
special kvm hook in qemu_system_reset.

Signed-off-by: Jan Kiszka <address@hidden>
---

 kvm-all.c |    8 ++++++++
 vl.c      |    2 --
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index 27ad80e..2ac5129 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -22,6 +22,7 @@
 
 #include "qemu-common.h"
 #include "sysemu.h"
+#include "hw/hw.h"
 #include "gdbstub.h"
 #include "kvm.h"
 
@@ -364,6 +365,11 @@ int kvm_uncoalesce_mmio_region(target_phys_addr_t start, 
ram_addr_t size)
     return ret;
 }
 
+static void kvm_reset_vcpus(void *opaque)
+{
+    kvm_sync_vcpus();
+}
+
 int kvm_init(int smp_cpus)
 {
     KVMState *s;
@@ -454,6 +460,8 @@ int kvm_init(int smp_cpus)
     if (ret < 0)
         goto err;
 
+    qemu_register_reset(kvm_reset_vcpus, INT_MAX, NULL);
+
     kvm_state = s;
 
     return 0;
diff --git a/vl.c b/vl.c
index f6d3ce5..04fedd4 100644
--- a/vl.c
+++ b/vl.c
@@ -3660,8 +3660,6 @@ void qemu_system_reset(void)
     for(re = first_reset_entry; re != NULL; re = re->next) {
         re->func(re->opaque);
     }
-    if (kvm_enabled())
-        kvm_sync_vcpus();
 }
 
 void qemu_system_reset_request(void)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]