From patchwork Thu Sep 10 13:57:48 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liran Schour X-Patchwork-Id: 33318 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 1FE75B7080 for ; Thu, 10 Sep 2009 23:32:05 +1000 (EST) Received: from localhost ([127.0.0.1]:47222 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mljko-0005c6-33 for incoming@patchwork.ozlabs.org; Thu, 10 Sep 2009 09:32:02 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MljkL-0005bd-SI for qemu-devel@nongnu.org; Thu, 10 Sep 2009 09:31:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MljkG-0005am-88 for qemu-devel@nongnu.org; Thu, 10 Sep 2009 09:31:32 -0400 Received: from [199.232.76.173] (port=58749 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MljkG-0005aj-2Y for qemu-devel@nongnu.org; Thu, 10 Sep 2009 09:31:28 -0400 Received: from mtagate3.de.ibm.com ([195.212.17.163]:59038) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MljkF-0001f3-Hb for qemu-devel@nongnu.org; Thu, 10 Sep 2009 09:31:27 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.13.1/8.13.1) with ESMTP id n8ADVMII022257 for ; Thu, 10 Sep 2009 13:31:22 GMT Received: from d12av01.megacenter.de.ibm.com (d12av01.megacenter.de.ibm.com [9.149.165.212]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n8ADVMpb2560040 for ; Thu, 10 Sep 2009 15:31:22 +0200 Received: from d12av01.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av01.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n8ADVMQ1030463 for ; Thu, 10 Sep 2009 15:31:22 +0200 Received: from localhost.localdomain (im4-64s.haifa.ibm.com [9.148.27.41]) by d12av01.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n8ADVLs3030458 for ; Thu, 10 Sep 2009 15:31:21 +0200 From: lirans@il.ibm.com To: qemu-devel@nongnu.org Date: Thu, 10 Sep 2009 16:57:48 +0300 Message-Id: <12525910683654-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 v2] 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..ea17609 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[3] = '\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).