From patchwork Tue Sep 10 03:43:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jules Wang X-Patchwork-Id: 273883 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D2E702C00D0 for ; Wed, 11 Sep 2013 00:27:49 +1000 (EST) Received: from localhost ([::1]:58316 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJOux-0007kM-2f for incoming@patchwork.ozlabs.org; Tue, 10 Sep 2013 10:27:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJFHE-0000TT-FQ for qemu-devel@nongnu.org; Tue, 10 Sep 2013 00:10:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJFH2-0002D5-12 for qemu-devel@nongnu.org; Tue, 10 Sep 2013 00:10:08 -0400 Received: from [2001:250:208:1181:6e92:bfff:fe00:bcdb] (port=45355 helo=mail.cs2c.com.cn) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJFH1-0002BF-Lx for qemu-devel@nongnu.org; Tue, 10 Sep 2013 00:09:55 -0400 Received: from localhost.localdomain (cs2c.com.cn [127.0.0.1]) by mail.cs2c.com.cn (NSMail) with ESMTPA id 35A0DB800E3; Tue, 10 Sep 2013 11:36:52 +0800 (CST) BANMAU_FRONT_USER_AUTHED: 1 BANMAU_FRONT_RESULT: 01 BANMAU_FRONT_SUSPICION_REASON: 0 X-Forward-For: 124.205.131.210 From: Jules Wang To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2013 11:43:25 +0800 Message-Id: <1378784607-7398-3-git-send-email-junqing.wang@cs2c.com.cn> X-Mailer: git-send-email 1.8.0.1 In-Reply-To: <1378784607-7398-1-git-send-email-junqing.wang@cs2c.com.cn> References: <1378784607-7398-1-git-send-email-junqing.wang@cs2c.com.cn> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2001:250:208:1181:6e92:bfff:fe00:bcdb X-Mailman-Approved-At: Tue, 10 Sep 2013 10:27:15 -0400 Cc: quintela@redhat.com, owasserm@redhat.com, Jules Wang , stefanha@redhat.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH RFC 2/4] Curling: cmdline interface X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Parse the word 'curling' when incoming/outgoing migration is starting. So we know whether to enable fault tolerant or not. Signed-off-by: Jules Wang --- include/migration/migration.h | 2 ++ migration.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/migration/migration.h b/include/migration/migration.h index 140e6b4..4cbb62f 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -162,4 +162,6 @@ size_t ram_control_save_page(QEMUFile *f, ram_addr_t block_offset, ram_addr_t offset, size_t size, int *bytes_sent); +bool ft_enabled(void); + #endif diff --git a/migration.c b/migration.c index 200d404..59c8f32 100644 --- a/migration.c +++ b/migration.c @@ -58,6 +58,12 @@ enum { static NotifierList migration_state_notifiers = NOTIFIER_LIST_INITIALIZER(migration_state_notifiers); +static bool ft_mode; +bool ft_enabled(void) +{ + return ft_mode; +} + /* When we add fault tolerance, we could have several migrations at once. For now we don't need to add dynamic creation of migration */ @@ -78,6 +84,11 @@ void qemu_start_incoming_migration(const char *uri, Error **errp) { const char *p; + if (strstart(uri, "curling:", &p)) { + ft_mode = true; + uri = p; + } + if (strstart(uri, "tcp:", &p)) tcp_start_incoming_migration(p, errp); #ifdef CONFIG_RDMA @@ -420,6 +431,11 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, s = migrate_init(¶ms); + if (strstart(uri, "curling:", &p)) { + ft_mode = true; + uri = p; + } + if (strstart(uri, "tcp:", &p)) { tcp_start_outgoing_migration(s, p, &local_err); #ifdef CONFIG_RDMA