aboutsummaryrefslogtreecommitdiff
path: root/kvm-all.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-05-02 00:29:37 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-05-22 10:50:34 -0500
commitd33a1810d7f558dd1d486bc84f1cf8f96c982e2d (patch)
treef41931bb085bf30f46539d2e053c77d7856b44a8 /kvm-all.c
parent8217606e6edb49591b4a6fd5a0d1229cebe470a9 (diff)
kvm: Rework VCPU reset
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 <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r--kvm-all.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/kvm-all.c b/kvm-all.c
index eb4b9eab82..c9f09c7e18 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"
@@ -376,6 +377,11 @@ int kvm_check_extension(KVMState *s, unsigned int extension)
return ret;
}
+static void kvm_reset_vcpus(void *opaque)
+{
+ kvm_sync_vcpus();
+}
+
int kvm_init(int smp_cpus)
{
KVMState *s;
@@ -462,6 +468,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;