From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWMLV-0002Ig-Nh for qemu-devel@nongnu.org; Tue, 23 Sep 2014 05:25:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWMLR-0008Pp-1p for qemu-devel@nongnu.org; Tue, 23 Sep 2014 05:25:17 -0400 Received: from [59.151.112.132] (port=47516 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWMLQ-00083l-Kb for qemu-devel@nongnu.org; Tue, 23 Sep 2014 05:25:12 -0400 From: Yang Hongyang Date: Tue, 23 Sep 2014 17:23:55 +0800 Message-ID: <1411464235-5653-24-git-send-email-yanghy@cn.fujitsu.com> In-Reply-To: <1411464235-5653-1-git-send-email-yanghy@cn.fujitsu.com> References: <1411464235-5653-1-git-send-email-yanghy@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [RFC PATCH v2 23/23] COLO nic: setup/teardown colo nic devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: GuiJianfeng@cn.fujitsu.com, yunhong.jiang@intel.com, eddie.dong@intel.com, dgilbert@redhat.com, mrhines@linux.vnet.ibm.com, yanghy@cn.fujitsu.com setup/teardown colo nic devices when enter/leave colo process. Signed-off-by: Yang Hongyang --- migration-colo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/migration-colo.c b/migration-colo.c index 1da5629..13f55d9 100644 --- a/migration-colo.c +++ b/migration-colo.c @@ -17,6 +17,7 @@ #include "migration/migration-colo.h" #include #include "qemu/error-report.h" +#include "net/colo-nic.h" /* * checkpoint timer: unit ms @@ -121,6 +122,7 @@ static void ctl_error_handler(void *opaque, int err) /* TODO: determine whether we need to failover */ /* FIXME: we will not failover currently, just kill slave */ error_report("error: colo transmission failed!"); + colo_teardown_nic(true); exit(1); } else if (colo_is_master()) { /* Master still alive, do not failover */ @@ -301,6 +303,7 @@ static void *colo_thread(void *opaque) qdev_hotplug = 0; + colo_configure_nic(false); /* * Wait for slave finish loading vm states and enter COLO * restore. @@ -343,6 +346,7 @@ out: } colo_compare_destroy(); + colo_teardown_nic(false); migrate_set_state(s, MIG_STATE_COLO, MIG_STATE_COMPLETED); @@ -442,6 +446,7 @@ void colo_process_incoming_checkpoints(QEMUFile *f) } create_and_init_ram_cache(); + colo_configure_nic(true); ret = colo_ctl_put(ctl, COLO_READY); if (ret) { @@ -521,6 +526,7 @@ out: } release_ram_cache(); + colo_teardown_nic(true); if (ctl) { qemu_fclose(ctl); -- 1.9.1