From patchwork Fri Oct 14 13:08:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 9376851 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 9318960779 for ; Fri, 14 Oct 2016 13:29:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8442C2A6B2 for ; Fri, 14 Oct 2016 13:29:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 790B12A6B4; Fri, 14 Oct 2016 13:29:02 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 141782A6B2 for ; Fri, 14 Oct 2016 13:29:02 +0000 (UTC) Received: from localhost ([::1]:47311 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bv2Xl-0005tu-5U for patchwork-qemu-devel@patchwork.kernel.org; Fri, 14 Oct 2016 09:29:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bv2FR-0006jL-T4 for qemu-devel@nongnu.org; Fri, 14 Oct 2016 09:10:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bv2FO-0007Eh-PP for qemu-devel@nongnu.org; Fri, 14 Oct 2016 09:10:04 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:33004 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bv2FO-00073X-I9; Fri, 14 Oct 2016 09:10:02 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2ArAgCE2ABY/5tjdVtcHAEBBAEBCgEBgzwBAQEBAR2BU400lV4BAQEBAQEFAYEXAZIsgg+CCIYiAoIOOBQBAgEBAQEBAQFeJ4RiAgQnUhA/EjwbGYhWAcMFAQEIKIVyglCGYIEDhHYdBYg8hgN0ilOJLYZTgW6EZ4MUhgyQeB42RAYIhGxviDUBAQE X-IPAS-Result: A2ArAgCE2ABY/5tjdVtcHAEBBAEBCgEBgzwBAQEBAR2BU400lV4BAQEBAQEFAYEXAZIsgg+CCIYiAoIOOBQBAgEBAQEBAQFeJ4RiAgQnUhA/EjwbGYhWAcMFAQEIKIVyglCGYIEDhHYdBYg8hgN0ilOJLYZTgW6EZ4MUhgyQeB42RAYIhGxviDUBAQE X-IronPort-AV: E=Sophos;i="5.31,493,1473112800"; d="scan'208";a="118727473" Received: from fanzine.igalia.com ([91.117.99.155]) by smtp4.mundo-r.com with ESMTP; 14 Oct 2016 15:09:18 +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 1bv2Eg-0004Qo-1s; Fri, 14 Oct 2016 15:09:18 +0200 Received: from berto by perseus.local with local (Exim 4.87) (envelope-from ) id 1bv2E2-0006ki-02; Fri, 14 Oct 2016 16:08:38 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Fri, 14 Oct 2016 16:08:23 +0300 Message-Id: <6c8fdc45f3f22a41164695982ce756dbed1a4205.1476450059.git.berto@igalia.com> 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 v11 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 --- 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 ===============