From patchwork Wed Oct 26 10:29:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 9396559 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BD2BD600BA for ; Wed, 26 Oct 2016 10:44:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7440729841 for ; Wed, 26 Oct 2016 10:44:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68E0E29945; Wed, 26 Oct 2016 10:44:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0ACC529841 for ; Wed, 26 Oct 2016 10:44:47 +0000 (UTC) Received: from localhost ([::1]:33070 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzLhO-0006Yk-5p for patchwork-qemu-devel@patchwork.kernel.org; Wed, 26 Oct 2016 06:44:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzLTY-0003gh-77 for qemu-devel@nongnu.org; Wed, 26 Oct 2016 06:30:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzLTW-0001qU-2z for qemu-devel@nongnu.org; Wed, 26 Oct 2016 06:30:28 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:61906 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzLTV-0001nL-SH; Wed, 26 Oct 2016 06:30:26 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BPAgB1hRBY/5tjdVtcHAEBBAEBCgEBgyoBAQEBAR2BSguNNZVXAQEBAQEBBQGBF5I0gg+CCYYiAoIAPxQBAgEBAQEBAQFiKIRjAgQnUhA/EjwbGYhYAcBAAQEIJ4VyglCGYIEDhHYdBYhFhgV0iliJM4ZtgW6EbYMXhhKRCx42UAYIhQpviGYBAQE X-IPAS-Result: A2BPAgB1hRBY/5tjdVtcHAEBBAEBCgEBgyoBAQEBAR2BSguNNZVXAQEBAQEBBQGBF5I0gg+CCYYiAoIAPxQBAgEBAQEBAQFiKIRjAgQnUhA/EjwbGYhYAcBAAQEIJ4VyglCGYIEDhHYdBYhFhgV0iliJM4ZtgW6EbYMXhhKRCx42UAYIhQpviGYBAQE X-IronPort-AV: E=Sophos;i="5.31,550,1473112800"; d="scan'208";a="202588404" Received: from fanzine.igalia.com ([91.117.99.155]) by smtp4.mundo-r.com with ESMTP; 26 Oct 2016 12:30:15 +0200 Received: from [194.100.51.2] (helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim) id 1bzLTK-00026W-4x; Wed, 26 Oct 2016 12:30:14 +0200 Received: from berto by perseus.local with local (Exim 4.87) (envelope-from ) id 1bzLSr-0001Zs-Tt; Wed, 26 Oct 2016 13:29:45 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Wed, 26 Oct 2016 13:29:25 +0300 Message-Id: X-Mailer: git-send-email 2.9.3 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.51.32.191 Subject: [Qemu-devel] [PATCH v12 11/19] docs: Document how to stream to an intermediate layer X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, Markus Armbruster , Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf --- docs/live-block-ops.txt | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/docs/live-block-ops.txt b/docs/live-block-ops.txt index a257087..2211d14 100644 --- a/docs/live-block-ops.txt +++ b/docs/live-block-ops.txt @@ -4,15 +4,20 @@ LIVE BLOCK OPERATIONS High level description of live block operations. Note these are not supported for use with the raw format at the moment. +Note also that this document is incomplete and it currently only +covers the 'stream' operation. Other operations supported by QEMU such +as 'commit', 'mirror' and 'backup' are not described here yet. Please +refer to the qapi/block-core.json file for an overview of those. + Snapshot live merge =================== Given a snapshot chain, described in this document in the following format: -[A] -> [B] -> [C] -> [D] +[A] <- [B] <- [C] <- [D] <- [E] -Where the rightmost object ([D] in the example) described is the current +Where the rightmost object ([E] in the example) described is the current image which the guest OS has write access to. To the left of it is its base image, and so on accordingly until the leftmost image, which has no base. @@ -21,11 +26,14 @@ The snapshot live merge operation transforms such a chain into a smaller one with fewer elements, such as this transformation relative to the first example: -[A] -> [D] +[A] <- [E] -Currently only forward merge with target being the active image is -supported, that is, data copy is performed in the right direction with -destination being the rightmost image. +Data is copied in the right direction with destination being the +rightmost image, but any other intermediate image can be specified +instead. In this example data is copied from [C] into [D], so [D] can +be backed by [B]: + +[A] <- [B] <- [D] <- [E] The operation is implemented in QEMU through image streaming facilities. @@ -35,14 +43,20 @@ streaming operation completes it raises a QMP event. 'block_stream' copies data from the backing file(s) into the active image. When finished, it adjusts the backing file pointer. -The 'base' parameter specifies an image which data need not be streamed from. -This image will be used as the backing file for the active image when the -operation is finished. +The 'base' parameter specifies an image which data need not be +streamed from. This image will be used as the backing file for the +destination image when the operation is finished. -In the example above, the command would be: +In the first example above, the command would be: -(qemu) block_stream virtio0 A +(qemu) block_stream virtio0 file-A.img +In order to specify a destination image different from the active +(rightmost) one we can use its node name instead. + +In the second example above, the command would be: + +(qemu) block_stream node-D file-B.img Live block copy ===============