From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:41765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qo6k3-0003MJ-1N for qemu-devel@nongnu.org; Tue, 02 Aug 2011 00:38:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qo6k1-0004Oc-RA for qemu-devel@nongnu.org; Tue, 02 Aug 2011 00:38:06 -0400 Received: from mail-vw0-f45.google.com ([209.85.212.45]:46607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qo6k1-0004O8-Jt for qemu-devel@nongnu.org; Tue, 02 Aug 2011 00:38:05 -0400 Received: by vws17 with SMTP id 17so5459237vws.4 for ; Mon, 01 Aug 2011 21:38:05 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4E36C5BB.2020606@redhat.com> References: <1311914994-20482-1-git-send-email-devin122@gmail.com> <1311914994-20482-22-git-send-email-devin122@gmail.com> <4E36C5BB.2020606@redhat.com> From: Devin Nakamura Date: Tue, 2 Aug 2011 00:37:45 -0400 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC 21/24] qcow2: add qcow2_open_conversion_target() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org On Mon, Aug 1, 2011 at 11:26 AM, Kevin Wolf wrote: > Am 29.07.2011 06:49, schrieb Devin Nakamura: >> Still in very raw form. =A0Not likely to work yet >> >> Signed-off-by: Devin Nakamura > > I don't think it's quite as easy. > > The problem is that qcow2 will access the image header in some places, > for example when growing the L1 or refcount table. You need to make sure > that it doesn't destroy the source format header, but writes to the > target format header at a different offset. This is why I've made sure to size the L1 and refcount tables so they wont need to be resized. But I suppose that's really a balancing act that's likely to break if someone makes changes to the current code, or when snapshots are implemented > I think much of qcow2_open and qcow2_open_conversion_target could be the > same. That is, both could call a common function that takes a parameter > for the header offset. I'm almost certain I could do that (considering I lifted a lot of the code for qcow2_open_conversion_target from qcow2_open) > The other part of qcow2_open_conversion_target (creating a new header > and a basic L1/refcount table) could possibly be shared with > qcow2_create2, though I'm not quite as sure about this one. >> + =A0 =A0//TODO: double check this, it seems a bit fishy > > That's my impression of the whole operation, too. :-) > > This is why I thought it would be nice to share this code with normal > image creation. Then we have this fishy code at least only once. > > Kevin >