aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorlirans@il.ibm.com <lirans@il.ibm.com>2009-11-02 15:40:58 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-11-17 08:49:30 -0600
commitc163b5cae98be8eda675b96e2dec4707bfa7fbbf (patch)
tree7c50d7a326b72c6aa1906e4055ecf049d667fad1 /vl.c
parent7cd1e32a860895ccca89eb90a0226efbcd969b55 (diff)
Block live migration
This patch introduces block migration called during live migration. Block are being copied to the destination in an async way. First the code will transfer the whole disk and then transfer all dirty blocks accumulted during the migration. Still need to improve transition from the iterative phase of migration to the end phase. For now transition will take place when all blocks transfered once, all the dirty blocks will be transfered during the end phase (guest is suspended). Changes from v4: - Global variabels moved to a global state structure allocated dynamically. - Minor coding style issues. - Poll block.c for tracking of dirty blocks instead of manage it here. Signed-off-by: Liran Schour <lirans@il.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/vl.c b/vl.c
index 18353f289e..c3f3c8f195 100644
--- a/vl.c
+++ b/vl.c
@@ -148,6 +148,8 @@ int main(int argc, char **argv)
#include "qemu-char.h"
#include "cache-utils.h"
#include "block.h"
+#include "block_int.h"
+#include "block-migration.h"
#include "dma.h"
#include "audio/audio.h"
#include "migration.h"
@@ -2972,9 +2974,7 @@ static int ram_save_live(QEMUFile *f, int stage, void *opaque)
bwidth = 0.000001;
/* try transferring iterative blocks of memory */
-
if (stage == 3) {
-
/* flush all remaining blocks regardless of rate limiting */
while (ram_save_block(f) != 0) {
bytes_transferred += TARGET_PAGE_SIZE;
@@ -5553,6 +5553,8 @@ int main(int argc, char **argv, char **envp)
bdrv_init_with_whitelist();
+ blk_mig_init();
+
/* we always create the cdrom drive, even if no disk is there */
drive_add(NULL, CDROM_ALIAS);
@@ -5569,7 +5571,8 @@ int main(int argc, char **argv, char **envp)
exit(1);
vmstate_register(0, &vmstate_timers ,&timers_state);
- register_savevm_live("ram", 0, 3, ram_save_live, NULL, ram_load, NULL);
+ register_savevm_live("ram", 0, 3, NULL, ram_save_live, NULL,
+ ram_load, NULL);
/* Maintain compatibility with multiple stdio monitors */
if (!strcmp(monitor_devices[0],"stdio")) {