From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXyTg-0006Zd-6z for qemu-devel@nongnu.org; Fri, 25 May 2012 13:39:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXyTe-0000D4-AX for qemu-devel@nongnu.org; Fri, 25 May 2012 13:39:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXyTe-0000Cn-0t for qemu-devel@nongnu.org; Fri, 25 May 2012 13:39:02 -0400 From: Kevin Wolf Date: Fri, 25 May 2012 19:38:46 +0200 Message-Id: <1337967534-12166-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1337967534-12166-1-git-send-email-kwolf@redhat.com> References: <1337967534-12166-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 02/10] qemu-img: Explain how rebase operation can be used to perform a 'diff' operation. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: "Richard W.M. Jones" Signed-off-by: Richard W.M. Jones Signed-off-by: Kevin Wolf --- qemu-img.texi | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/qemu-img.texi b/qemu-img.texi index b2ca3a5..6fc3c28 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -159,6 +159,24 @@ It can be used without an accessible old backing file, i.e. you can use it to fix an image whose backing file has already been moved/renamed. @end table +You can use @code{rebase} to perform a ``diff'' operation on two +disk images. This can be useful when you have copied or cloned +a guest, and you want to get back to a thin image on top of a +template or base image. + +Say that @code{base.img} has been cloned as @code{modified.img} by +copying it, and that the @code{modified.img} guest has run so there +are now some changes compared to @code{base.img}. To construct a thin +image called @code{diff.qcow2} that contains just the differences, do: + +@example +qemu-img create -f qcow2 -b modified.img diff.qcow2 +qemu-img rebase -b base.img diff.qcow2 +@end example + +At this point, @code{modified.img} can be discarded, since +@code{base.img + diff.qcow2} contains the same information. + @item resize @var{filename} [+ | -]@var{size} Change the disk image as if it had been created with @var{size}. -- 1.7.6.5