From patchwork Fri Jul 8 12:00:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jes Sorensen X-Patchwork-Id: 103831 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A6A20B6F00 for ; Fri, 8 Jul 2011 22:06:22 +1000 (EST) Received: from localhost ([::1]:42147 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qf9p5-0006Jn-8p for incoming@patchwork.ozlabs.org; Fri, 08 Jul 2011 08:06:19 -0400 Received: from eggs.gnu.org ([140.186.70.92]:33977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qf9ks-00064U-8Q for qemu-devel@nongnu.org; Fri, 08 Jul 2011 08:01:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qf9kp-0001uo-N5 for qemu-devel@nongnu.org; Fri, 08 Jul 2011 08:01:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qf9kp-0001ua-6E for qemu-devel@nongnu.org; Fri, 08 Jul 2011 08:01:55 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p68C1qBq028486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 8 Jul 2011 08:01:52 -0400 Received: from red-feather.gva.redhat.com (dhcp-144-167.gva.redhat.com [10.33.144.167]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p68C1nxN005342; Fri, 8 Jul 2011 08:01:51 -0400 From: Jes.Sorensen@redhat.com To: lcapitulino@redhat.com Date: Fri, 8 Jul 2011 14:00:13 +0200 Message-Id: <1310126413-13451-2-git-send-email-Jes.Sorensen@redhat.com> In-Reply-To: <1310126413-13451-1-git-send-email-Jes.Sorensen@redhat.com> References: <1310126413-13451-1-git-send-email-Jes.Sorensen@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 1/1] QMP: add snapshot_blkdev command 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 From: Jes Sorensen Add QMP bits for snapshot_blkdev command. This is the same as snapshot_blkdev in the human monitor. The command is synchronous. In the future async commands and or a break down of the functionality into multiple commands might be added. Signed-off-by: Jes Sorensen --- qmp-commands.hx | 38 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-) diff --git a/qmp-commands.hx b/qmp-commands.hx index 92c5c3a..eb135c1 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -694,6 +694,44 @@ Example: EQMP { + .name = "blockdev-snapshot", + .args_type = "device:B,snapshot_file:s?,format:s?", + .params = "device [new-image-file] [format]", + .help = "initiates a live snapshot\n\t\t\t" + "of device. If a new image file is specified, the\n\t\t\t" + "new image file will become the new root image.\n\t\t\t" + "If format is specified, the snapshot file will\n\t\t\t" + "be created in that format. Otherwise the\n\t\t\t" + "snapshot will be internal! (currently unsupported)", + .user_print = monitor_user_noop, + .mhandler.cmd_new = do_snapshot_blkdev, + }, + +SQMP +blockdev-snapshot-sync +---------------------- + +Synchronous snapshot of block device, using snapshot file as target, +if provided. + +Arguments: + +- "device": device name to snapshot (json-string) +- "snapshot_file": name of new image file (json-string) +- "format": format of new image (json-string) + +Example: + +-> { "execute": "blockdev-snapshot", "arguments": { "device": "ide-hd0", + "snapshot_file": + "/some/place/my-image", + "format": "qcow2" + } } +<- { "return": {} } + +EQMP + + { .name = "balloon", .args_type = "value:M", .params = "target",