From b0a46a333acfd78da56cf6aebb95f4a5dfb3a4f2 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Sat, 2 May 2009 00:22:51 +0200 Subject: kvm: Add missing bits to support live migration This patch adds the missing hooks to allow live migration in KVM mode. It adds proper synchronization before/after saving/restoring the VCPU states (note: PPC is untested), hooks into cpu_physical_memory_set_dirty_tracking() to enable dirty memory logging at KVM level, and synchronizes that drity log into QEMU's view before running ram_live_save(). Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori --- target-i386/machine.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'target-i386/machine.c') diff --git a/target-i386/machine.c b/target-i386/machine.c index 55716fe..69a03a4 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -4,6 +4,7 @@ #include "hw/isa.h" #include "exec-all.h" +#include "kvm.h" static void cpu_put_seg(QEMUFile *f, SegmentCache *dt) { @@ -29,6 +30,8 @@ void cpu_save(QEMUFile *f, void *opaque) int32_t a20_mask; int i; + cpu_synchronize_state(env, 0); + for(i = 0; i < CPU_NB_REGS; i++) qemu_put_betls(f, &env->regs[i]); qemu_put_betls(f, &env->eip); @@ -321,5 +324,6 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) /* XXX: compute redundant hflags bits */ env->hflags = hflags; tlb_flush(env, 1); + cpu_synchronize_state(env, 1); return 0; } -- cgit v1.1