From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWUim-0003pY-E5 for qemu-devel@nongnu.org; Mon, 21 May 2012 11:40:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWUih-0007p1-FI for qemu-devel@nongnu.org; Mon, 21 May 2012 11:40:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26060) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWUih-0007oL-7v for qemu-devel@nongnu.org; Mon, 21 May 2012 11:40:27 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4LFeP69004665 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 21 May 2012 11:40:25 -0400 Message-ID: <4FBA61E1.1010003@redhat.com> Date: Mon, 21 May 2012 17:40:17 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1337268840-4779-1-git-send-email-rjones@redhat.com> <4FBA4332.6050201@redhat.com> <20120521135926.GM15276@amd.home.annexia.org> <4FBA5F95.9010105@redhat.com> In-Reply-To: <4FBA5F95.9010105@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3] qemu-img: Implement 'diff' operation. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: "Richard W.M. Jones" , qemu-devel@nongnu.org Am 21.05.2012 17:30, schrieb Eric Blake: > On 05/21/2012 07:59 AM, Richard W.M. Jones wrote: > >>> >>> Hm, I'm wondering... If I have a command line like this: >>> >>> qemu-img diff -b base.img modified.img diff.qcow2 >>> >>> Would this be equivalent to this sequence? >>> >>> qemu-img create -f qcow2 -b modified.img diff.qcow2 >>> qemu-img rebase -b base.img diff.qcow2 > > So 'qemu-img rebase' is able to rebase to any other image, even if > base.img is nowhere in the backing chain of modified.img? That means it > is more powerful than runtime 'block-stream' monitor command under qemu, > which can only do a block pull from an earlier point in the backing chain. Correct. 'qemu-img rebase' compares the old and the new backing file for each unallocated cluster of the overlay, and if they differ, it copies the data from the old backing file into the overlay. Not sure if there would be any real use for a real live rebase, but even if there was, implementing it probably wouldn't be a priority for most of us. >> Yes. I tried for a while to work out the sequence of commands that >> could make a diff using 'qemu-img rebase', but it wasn't obvious and I >> gave up. It should at least be documented. How about the attached >> patch? > > Seems reasonable to me. A two-command sequence of qemu-img to > manipulate offline images isn't all that bad; it's different from the > case of a disk image in active use by qemu. Even there you use a two-command sequence when you do an external 'qemu-img create' and then use the 'existing' mode of snapshots or mirroring. :-) Kevin