From patchwork Fri Apr 13 16:23:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 152344 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 545FBB6FF7 for ; Sat, 14 Apr 2012 02:36:38 +1000 (EST) Received: from localhost ([::1]:39830 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIjIl-0001KQ-2t for incoming@patchwork.ozlabs.org; Fri, 13 Apr 2012 12:24:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIjIB-0008Jg-II for qemu-devel@nongnu.org; Fri, 13 Apr 2012 12:24:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SIjI9-0008S8-KV for qemu-devel@nongnu.org; Fri, 13 Apr 2012 12:24:11 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:40589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIjI9-0007ul-BJ for qemu-devel@nongnu.org; Fri, 13 Apr 2012 12:24:09 -0400 Received: by mail-pz0-f46.google.com with SMTP id z9so4706424dad.33 for ; Fri, 13 Apr 2012 09:24:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=3V6JJCpzzndpT/PUx/l8ZLaKaFFHgxAHEEC/P2R8XzE=; b=J8jC7xlTDegChPuKQTyizAFlLOxTV3PMeeO2CqTN/08FryhVCXJKKgZLCaG/Ut6V6M /idk/4NX9O0sqtzVMOVnLrcHSQeU3sJ1cMFfJk9M1Dc7EPfQ1lQAp5/z2lsj+WVedAGu PISZ4FXznSyUjFwez2Qx1SejW9Wj1PkqkSQoCxfNE8/sxq7+syjlzGDKSDdzL3fcW2j3 2qrpua6Rv3gKKr1rYamkZEQdG+F9thdKgB//3qzs8G2g3++bZgdKGM+fPpqANmPwhJ1x obunTdfXQ/9YbyQN7/B66WviXIt97uw2TT6W0odp3qG0SRCzc2M3un5gvjJ6hTEe26lX NGwQ== Received: by 10.68.129.99 with SMTP id nv3mr5662987pbb.153.1334334248453; Fri, 13 Apr 2012 09:24:08 -0700 (PDT) Received: from yakj.usersys.redhat.com (93-34-182-16.ip50.fastwebnet.it. [93.34.182.16]) by mx.google.com with ESMTPS id s7sm9116719pbl.31.2012.04.13.09.24.04 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 Apr 2012 09:24:07 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 13 Apr 2012 18:23:18 +0200 Message-Id: <1334334198-30899-9-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.9.3 In-Reply-To: <1334334198-30899-1-git-send-email-pbonzini@redhat.com> References: <1334334198-30899-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.46 Cc: kwolf@redhat.com, fsimonce@redhat.com, mtosatti@redhat.com, eblake@redhat.com, stefanha@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH 8/8] docs: add mirroring to live block operations 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 Signed-off-by: Paolo Bonzini --- docs/live-block-ops.txt | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/docs/live-block-ops.txt b/docs/live-block-ops.txt index a257087..caf3466 100644 --- a/docs/live-block-ops.txt +++ b/docs/live-block-ops.txt @@ -1,8 +1,7 @@ LIVE BLOCK OPERATIONS ===================== -High level description of live block operations. Note these are not -supported for use with the raw format at the moment. +High level description of live block operations. Snapshot live merge =================== @@ -44,15 +43,40 @@ In the example above, the command would be: (qemu) block_stream virtio0 A +Live block migration +==================== + +Migrating an in use image to another destination in the filesystem +is done through image mirroring. The idea is to execute +'drive_mirror virtio0 /new-path/disk.img qcow2' while the guest +is running. The topmost image ([D] in the example above) will +be copied to the given path, and the two can be kept in sync. + +Progress can be monitored using 'info block-jobs'. Once this command +reports something like + + Type mirror, device virtio0: Completed 1048576000 of 1048576000 bytes + +it is possible to switch to the destination using + +(qemu) drive_reopen virtio0 /new-path/disk.img + +This assumes that all images A/B/C are also present under /new-path +or. An image can be omitted from the destination if one of the images +refers to its backing file using an absolute path. + + Live block copy =============== To copy an in use image to another destination in the filesystem, one -should create a live snapshot in the desired destination, then stream -into that image. Example: - -(qemu) snapshot_blkdev ide0-hd0 /new-path/disk.img qcow2 +can also use mirroring with the -f option. -(qemu) block_stream ide0-hd0 +(qemu) drive_mirror -f virtio0 /new-path/disk.img qcow2 +Note that if one image in the chain is in raw format, the +resulting copy might not be thin-provisioned anymore, depending on +the underlying file system. +It is also possible to use raw as the format of the destination image. +Converting an image to raw will properly support thin provisioning.