aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-05-02 00:22:51 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-05-22 10:50:33 -0500
commitb0a46a333acfd78da56cf6aebb95f4a5dfb3a4f2 (patch)
tree7bb31d0a51df11ba7d6b7b2b6bb11562bae0fce2 /exec.c
parent151f7749f26e8b0eaca517376a89c01430c584e5 (diff)
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 <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index 544fb43074..723de89bf4 100644
--- a/exec.c
+++ b/exec.c
@@ -516,6 +516,8 @@ static void cpu_common_save(QEMUFile *f, void *opaque)
{
CPUState *env = opaque;
+ cpu_synchronize_state(env, 0);
+
qemu_put_be32s(f, &env->halted);
qemu_put_be32s(f, &env->interrupt_request);
}
@@ -533,6 +535,7 @@ static int cpu_common_load(QEMUFile *f, void *opaque, int version_id)
version_id is increased. */
env->interrupt_request &= ~0x01;
tlb_flush(env, 1);
+ cpu_synchronize_state(env, 1);
return 0;
}
@@ -1923,6 +1926,9 @@ void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t end,
int cpu_physical_memory_set_dirty_tracking(int enable)
{
in_migration = enable;
+ if (kvm_enabled()) {
+ return kvm_set_migration_log(enable);
+ }
return 0;
}