From patchwork Mon Apr 18 14:27:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jes Sorensen X-Patchwork-Id: 91764 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 70F6D1007D9 for ; Tue, 19 Apr 2011 00:27:57 +1000 (EST) Received: from localhost ([::1]:32822 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBpQc-0008Nk-Bb for incoming@patchwork.ozlabs.org; Mon, 18 Apr 2011 10:27:50 -0400 Received: from eggs.gnu.org ([140.186.70.92]:54025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBpQS-0008Nf-KU for qemu-devel@nongnu.org; Mon, 18 Apr 2011 10:27:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QBpQR-0002zc-ES for qemu-devel@nongnu.org; Mon, 18 Apr 2011 10:27:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11063) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBpQQ-0002zJ-Uh for qemu-devel@nongnu.org; Mon, 18 Apr 2011 10:27:39 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3IERb7B000500 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 18 Apr 2011 10:27:37 -0400 Received: from red-feather.redhat.com (ovpn-113-39.phx2.redhat.com [10.3.113.39]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p3IERY9T010322; Mon, 18 Apr 2011 10:27:36 -0400 From: Jes.Sorensen@redhat.com To: kwolf@redhat.com Date: Mon, 18 Apr 2011 16:27:01 +0200 Message-Id: <1303136821-13333-2-git-send-email-Jes.Sorensen@redhat.com> In-Reply-To: <1303136821-13333-1-git-send-email-Jes.Sorensen@redhat.com> References: <1303136821-13333-1-git-send-email-Jes.Sorensen@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 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 v2 1/1] Add QMP bits for blockdev-snapshot-sync. 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 This is quivalent to snapshot_blkdev in the human monitor, with _sync added to the command name to make it explicit that the command is synchronous and leave space for a future async version. Signed-off-by: Jes Sorensen --- qmp-commands.hx | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/qmp-commands.hx b/qmp-commands.hx index fbd98ee..b8f537c 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -667,6 +667,32 @@ Example: EQMP { + .name = "blockdev-snapshot-sync", + .args_type = "device:B,snapshot_file:s?,format:s?", + .params = "device [new-image-file] [format]", + .user_print = monitor_user_noop, + .mhandler.cmd_new = do_snapshot_blkdev, + }, + +SQMP +Synchronous snapshot of block device, using snapshot file as target +if provided. + +If a new image file is specified, the new image file will become the +new root image. If format is specified, the snapshot file will be +created in that format. Otherwise the snapshot will be internal! +(currently unsupported). + +Errors: +If creating the new snapshot image fails, QEMU will continue running +on the original image. If switching to the newly created image fails, +it will be attempted to fall back to the original image and return +QERR_OPEN_FILE_FAILED with the snapshot filename. If re-opening +the original image fails, QERR_OPEN_FILE_FAILED will be returned with +the original image filename. +EQMP + + { .name = "balloon", .args_type = "value:M", .params = "target",