mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
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>
This commit is contained in:
parent
151f7749f2
commit
b0a46a333a
4 changed files with 21 additions and 1 deletions
|
@ -1,11 +1,14 @@
|
|||
#include "hw/hw.h"
|
||||
#include "hw/boards.h"
|
||||
#include "kvm.h"
|
||||
|
||||
void cpu_save(QEMUFile *f, void *opaque)
|
||||
{
|
||||
CPUState *env = (CPUState *)opaque;
|
||||
unsigned int i, j;
|
||||
|
||||
cpu_synchronize_state(env, 0);
|
||||
|
||||
for (i = 0; i < 32; i++)
|
||||
qemu_put_betls(f, &env->gpr[i]);
|
||||
#if !defined(TARGET_PPC64)
|
||||
|
@ -174,5 +177,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
|
|||
qemu_get_sbe32s(f, &env->mmu_idx);
|
||||
qemu_get_sbe32s(f, &env->power_mode);
|
||||
|
||||
cpu_synchronize_state(env, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue