From patchwork Thu Sep 10 10:23:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liran Schour X-Patchwork-Id: 33309 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id A21D6B70B0 for ; Thu, 10 Sep 2009 21:10:22 +1000 (EST) Received: from localhost ([127.0.0.1]:35148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MlhXf-0005gs-6U for incoming@patchwork.ozlabs.org; Thu, 10 Sep 2009 07:10:19 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MlgPX-0004tL-L8 for qemu-devel@nongnu.org; Thu, 10 Sep 2009 05:57:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MlgPS-0004rZ-Cb for qemu-devel@nongnu.org; Thu, 10 Sep 2009 05:57:50 -0400 Received: from [199.232.76.173] (port=44782 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MlgPS-0004rP-6n for qemu-devel@nongnu.org; Thu, 10 Sep 2009 05:57:46 -0400 Received: from mtagate8-bp.emea.ibm.com ([195.212.17.168]:60878 helo=mtagate8.de.ibm.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MlgPR-0007oC-I9 for qemu-devel@nongnu.org; Thu, 10 Sep 2009 05:57:45 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate8.de.ibm.com (8.13.1/8.13.1) with ESMTP id n8A9vWpm026197 for ; Thu, 10 Sep 2009 09:57:32 GMT Received: from d12av04.megacenter.de.ibm.com (d12av04.megacenter.de.ibm.com [9.149.165.229]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n8A9vVGP2617382 for ; Thu, 10 Sep 2009 11:57:31 +0200 Received: from d12av04.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n8A9vVU9016138 for ; Thu, 10 Sep 2009 11:57:31 +0200 Received: from localhost.localdomain (im4-64s.haifa.ibm.com [9.148.27.41]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n8A9vU1m016124 for ; Thu, 10 Sep 2009 11:57:31 +0200 From: lirans@il.ibm.com To: qemu-devel@nongnu.org Date: Thu, 10 Sep 2009 13:23:55 +0300 Message-Id: <1252578235119-git-send-email-lirans@il.ibm.com> X-Mailer: git-send-email 1.5.2.4 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: [Qemu-devel] [PATCH 3/3] Enable migration without shared storage from the monitor X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patch adds the option to activate non-shared storage migration from the monitor. The migration command is as follows: (qemu) migrate -d tcp:0:4444 # for ordinary live migration (qemu) migrate -d blk tcp:0:4444 # for live migration with complete storage copy (qemu) migrate -d blk inc tcp:0:4444 # for live migration with incremental storage copy, storage is cow based. diff --git a/monitor.c b/monitor.c index 8d5165c..c8a6228 100644 --- a/monitor.c +++ b/monitor.c @@ -37,6 +37,7 @@ #include "readline.h" #include "console.h" #include "block.h" +#include "block-migration.h" #include "audio/audio.h" #include "disas.h" #include "balloon.h" @@ -2507,6 +2508,24 @@ static void monitor_handle_command(Monitor *mon, const char *cmdline) goto add_str; } } + + if (*typestr == '!') { + char flag[4]; + char * cmd_flag; + typestr++; + memcpy(flag, typestr, 3); + typestr += 3; + flag[4] = '\0'; + + cmd_flag = strstr(p, flag); + if (cmd_flag != p) { + /* no optional string: NULL argument */ + str = NULL; + goto add_str; + } + + } + ret = get_str(buf, sizeof(buf), &p); if (ret < 0) { switch(c) { diff --git a/qemu-monitor.hx b/qemu-monitor.hx index dea0704..e466774 100644 --- a/qemu-monitor.hx +++ b/qemu-monitor.hx @@ -463,8 +463,8 @@ STEXI Inject an NMI on the given CPU (x86 only). ETEXI - { "migrate", "-ds", do_migrate, - "[-d] uri", "migrate to URI (using -d to not wait for completion)" }, + { "migrate", "-ds!blks!incs", do_migrate, + "[-d] [blk] [inc] uri", "migrate to URI (using -d - to not wait \n\t\tfor completion,\n\t\t [blk] - for migration without shared storage,\n\t\t [inc] - for incremental migration if base image is identical)" }, STEXI @item migrate [-d] @var{uri} Migrate to @var{uri} (using -d to not wait for completion).