Received: from eggs.gnu.org ([2001:4830:134:3::10]:50587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VY45V-0004RH-3q for qemu-devel@nongnu.org; Sun, 20 Oct 2013 21:15:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VY45M-0004OB-6y for qemu-devel@nongnu.org; Sun, 20 Oct 2013 21:15:17 -0400 Received: from e33.co.us.ibm.com ([32.97.110.151]:41488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VY45M-0004Nz-0G for qemu-devel@nongnu.org; Sun, 20 Oct 2013 21:15:08 -0400 Received: from /spool/local by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 20 Oct 2013 19:15:07 -0600 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 2CD2A19D803E for ; Sun, 20 Oct 2013 19:15:03 -0600 (MDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r9L1F4qQ035228 for ; Sun, 20 Oct 2013 19:15:05 -0600 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r9L1IH7w001325 for ; Sun, 20 Oct 2013 19:18:17 -0600 From: mrhines@linux.vnet.ibm.com Date: Mon, 21 Oct 2013 01:14:22 +0000 Message-Id: <1382318062-6288-13-git-send-email-mrhines@linux.vnet.ibm.com> In-Reply-To: <1382318062-6288-1-git-send-email-mrhines@linux.vnet.ibm.com> References: <1382318062-6288-1-git-send-email-mrhines@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC PATCH v1: 12/12] mc: activate and use MC core logic if requested List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, quintela@redhat.com, owasserm@redhat.com, onom@us.ibm.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com, pbonzini@redhat.com From: "Michael R. Hines" Building on the previous patches, this finally actually activates protection of the VM by kicking off an MC thread after the initial live migration completes. The live migration thread will get destroyed and the MC thread will run and never die. Signed-off-by: Michael R. Hines --- migration.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/migration.c b/migration.c index 8e0827e..15ad264 100644 --- a/migration.c +++ b/migration.c @@ -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; -- 1.8.1.2