From patchwork Mon Sep 7 09:21:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liran Schour X-Patchwork-Id: 33068 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 22EADB70CF for ; Mon, 7 Sep 2009 18:56:36 +1000 (EST) Received: from localhost ([127.0.0.1]:37137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mka1Y-0007Lh-8I for incoming@patchwork.ozlabs.org; Mon, 07 Sep 2009 04:56:32 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mka0y-0007LX-FB for qemu-devel@nongnu.org; Mon, 07 Sep 2009 04:55:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mka0t-0007L5-UR for qemu-devel@nongnu.org; Mon, 07 Sep 2009 04:55:56 -0400 Received: from [199.232.76.173] (port=36862 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mka0t-0007L2-JY for qemu-devel@nongnu.org; Mon, 07 Sep 2009 04:55:51 -0400 Received: from mtagate5.de.ibm.com ([195.212.17.165]:58449) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mka0s-0002g7-Vw for qemu-devel@nongnu.org; Mon, 07 Sep 2009 04:55:51 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate5.de.ibm.com (8.13.1/8.13.1) with ESMTP id n878tgYx022005 for ; Mon, 7 Sep 2009 08:55:42 GMT Received: from d12av03.megacenter.de.ibm.com (d12av03.megacenter.de.ibm.com [9.149.165.213]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n878tgF82740458 for ; Mon, 7 Sep 2009 10:55:42 +0200 Received: from d12av03.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av03.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n878tguj021580 for ; Mon, 7 Sep 2009 10:55:42 +0200 Received: from localhost.localdomain (im4-64s.haifa.ibm.com [9.148.27.41]) by d12av03.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n878tfNh021577 for ; Mon, 7 Sep 2009 10:55:41 +0200 From: lirans@il.ibm.com To: qemu-devel@nongnu.org Date: Mon, 7 Sep 2009 12:21:33 +0300 Message-Id: <12523152933101-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).