diff options
| author | Jan Kiszka <jan.kiszka@siemens.com> | 2009-05-02 00:22:51 +0200 |
|---|---|---|
| committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-05-22 10:50:33 -0500 |
| commit | b0a46a333acfd78da56cf6aebb95f4a5dfb3a4f2 (patch) | |
| tree | 7bb31d0a51df11ba7d6b7b2b6bb11562bae0fce2 /vl.c | |
| parent | 151f7749f26e8b0eaca517376a89c01430c584e5 (diff) | |
| download | focaccia-qemu-b0a46a333acfd78da56cf6aebb95f4a5dfb3a4f2.tar.gz focaccia-qemu-b0a46a333acfd78da56cf6aebb95f4a5dfb3a4f2.zip | |
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 'vl.c')
| -rw-r--r-- | vl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vl.c b/vl.c index c9b2aa4d25..5079a1cb5e 100644 --- a/vl.c +++ b/vl.c @@ -3232,13 +3232,18 @@ static int ram_save_live(QEMUFile *f, int stage, void *opaque) { ram_addr_t addr; + if (cpu_physical_sync_dirty_bitmap(0, last_ram_offset) != 0) { + qemu_file_set_error(f); + return 0; + } + if (stage == 1) { /* Make sure all dirty bits are set */ for (addr = 0; addr < last_ram_offset; addr += TARGET_PAGE_SIZE) { if (!cpu_physical_memory_get_dirty(addr, MIGRATION_DIRTY_FLAG)) cpu_physical_memory_set_dirty(addr); } - + /* Enable dirty memory tracking */ cpu_physical_memory_set_dirty_tracking(1); |