From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxFtd-0007za-GL for qemu-devel@nongnu.org; Mon, 21 Jan 2013 06:50:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxFta-0003wM-9z for qemu-devel@nongnu.org; Mon, 21 Jan 2013 06:50:37 -0500 Received: from nodalink.pck.nerim.net ([62.212.105.220]:45361 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxFta-0003uj-1J for qemu-devel@nongnu.org; Mon, 21 Jan 2013 06:50:34 -0500 Date: Mon, 21 Jan 2013 12:51:04 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20130121115104.GA4508@irqsave.net> References: <1358353497-5292-1-git-send-email-benoit@irqsave.net> <1358353497-5292-21-git-send-email-benoit@irqsave.net> <50F6E75D.1050707@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <50F6E75D.1050707@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC V5 20/36] qcow2: Drop hash for a given cluster when dedup makes refcount > 2^16/2. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com > You are hardcoding to a width of 16 bits; however, version 3 makes the > refcount field variable-sized: > > 96 - 99: refcount_order > Describes the width of a reference count block entr= y > (width > in bits =3D 1 << refcount_order). For version 2 > images, the > order is always assumed to be 4 (i.e. the width is > 16 bits). Currently the qcow2 code doesn't support anything but refcount_order =3D=3D= 4. In qcow2.c qcow_open there is: be32_to_cpus(&header.refcount_order); to get the qcow2 order followed by: /* Check support for various header values */ if (header.refcount_order !=3D 4) { report_unsupported(bs, "%d bit reference counts", 1 << header.refcount_order); ret =3D -ENOTSUP; goto fail; } I guess the code doesn't need any special handling for now. > Hmm, what happens if refcount_order is 0 to disable reference counting? > That setting is valid for creating a qcow2 file that can't be used for > internal snapshots. But it also interferes with dedup; so you probably > want to add some additional requirements in the spec (patch 1/36) that > when dedup is in use, refcount_order must be a minimum value (or requir= e > that it be exactly 4, for a width of 16 bits). I'll do that. Regards Beno=EEt