summaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-12-01 15:19:55 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 11:45:49 -0600
commit90697be8896ce364456b81d3ba7eaadd10b1766e (patch)
tree02597ef53db6b6c20423e379e5ab125941bdbb8a /savevm.c
parent792773b2255d25c6f5fe9dfa0ae200debab92de4 (diff)
downloadqemu-90697be8896ce364456b81d3ba7eaadd10b1766e.zip
live migration: Serialize vmstate saving in stage 2
The effect of this patch with current block migration is that its stage 2, ie. the first full walk-through of the block devices will be performed completely before RAM migration starts. This ensures that continuously changing RAM pages are not re-synchronized all the time while block migration is not completed. Future versions of block migration which will respect the specified downtime will generate a different pattern: After RAM migration has started as well, block migration may also continue to inject dirty blocks into the RAM stream once it detects that the number of pending blocks would extend the downtime unacceptably. Note that all this relies on the current registration order: block before RAM migration. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/savevm.c b/savevm.c
index db44ed607b..aefe052cd3 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1321,7 +1321,14 @@ int qemu_savevm_state_iterate(Monitor *mon, QEMUFile *f)
qemu_put_byte(f, QEMU_VM_SECTION_PART);
qemu_put_be32(f, se->section_id);
- ret &= !!se->save_live_state(mon, f, QEMU_VM_SECTION_PART, se->opaque);
+ ret = se->save_live_state(mon, f, QEMU_VM_SECTION_PART, se->opaque);
+ if (!ret) {
+ /* Do not proceed to the next vmstate before this one reported
+ completion of the current stage. This serializes the migration
+ and reduces the probability that a faster changing state is
+ synchronized over and over again. */
+ break;
+ }
}
if (ret)