summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-11-30 18:21:21 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 10:48:53 -0600
commit4ec7fcc7da214d48d39b63fd2c6a4d19ac42ae04 (patch)
tree5bb2081c5fbf6349a8241e715a0cece055105e72 /vl.c
parent9a743e5ba32f7a620baa0b3d3808e88d2433e861 (diff)
downloadqemu-4ec7fcc7da214d48d39b63fd2c6a4d19ac42ae04.tar.gz
live migration: Allow cleanup after cancellation or error
Introduce qemu_savevm_state_cancel and inject a stage -1 to cancel a live migration. This gives the involved subsystems a chance to clean up dynamically allocated resources. Namely, the block migration layer can now free its device descriptors and pending blocks. 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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index 62427b8f97..f6c655b8de 100644
--- a/vl.c
+++ b/vl.c
@@ -2934,6 +2934,11 @@ static int ram_save_live(QEMUFile *f, int stage, void *opaque)
double bwidth = 0;
uint64_t expected_time = 0;
+ if (stage < 0) {
+ cpu_physical_memory_set_dirty_tracking(0);
+ return 0;
+ }
+
if (cpu_physical_sync_dirty_bitmap(0, TARGET_PHYS_ADDR_MAX) != 0) {
qemu_file_set_error(f);
return 0;