@@ -94,6 +94,9 @@ static void process_incoming_migration_co(void *opaque)
int ret;
ret = qemu_loadvm_state(f);
+ if (ret >= 0) {
+ mc_process_incoming_checkpoints_if_requested(f);
+ }
qemu_fclose(f);
if (ret < 0) {
fprintf(stderr, "load of migration failed\n");
@@ -670,11 +673,27 @@ static void *migration_thread(void *opaque)
s->downtime = end_time - start_time;
runstate_set(RUN_STATE_POSTMIGRATE);
} else {
+ if(migrate_use_mc()) {
+ qemu_fflush(s->file);
+ if (migrate_use_mc_net()) {
+ if (mc_enable_buffering() < 0 ||
+ mc_start_buffer() < 0) {
+ migrate_set_state(s, MIG_STATE_ACTIVE, MIG_STATE_ERROR);
+ }
+ }
+ }
+
if (old_vm_running) {
vm_start();
}
}
- qemu_bh_schedule(s->cleanup_bh);
+
+ if (migrate_use_mc() && s->state != MIG_STATE_ERROR) {
+ mc_init_checkpointer(s);
+ } else {
+ qemu_bh_schedule(s->cleanup_bh);
+ }
+
qemu_mutex_unlock_iothread();
return NULL;