Received: from eggs.gnu.org ([2001:4830:134:3::10]:34132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtzSS-0003yc-NQ for qemu-devel@nongnu.org; Thu, 27 Nov 2014 08:50:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XtzSJ-0000p3-M6 for qemu-devel@nongnu.org; Thu, 27 Nov 2014 08:50:08 -0500 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:41982) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtzSJ-0000oz-G3 for qemu-devel@nongnu.org; Thu, 27 Nov 2014 08:49:59 -0500 Received: by mail-wi0-f180.google.com with SMTP id n3so8384257wiv.13 for ; Thu, 27 Nov 2014 05:49:58 -0800 (PST) Date: Thu, 27 Nov 2014 13:49:53 +0000 From: Stefan Hajnoczi Message-ID: <20141127134953.GC15586@stefanha-thinkpad.lan> References: <1416503198-17031-1-git-send-email-mreitz@redhat.com> <1416503198-17031-4-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YD3LsXFS42OYHhNZ" Content-Disposition: inline In-Reply-To: <1416503198-17031-4-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 03/22] qcow2: Use 64 bits for refcount values List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi --YD3LsXFS42OYHhNZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 20, 2014 at 06:06:19PM +0100, Max Reitz wrote: > Refcounts may have a width of up to 64 bits, so qemu should use the same > width to represent refcount values internally. >=20 > Since for instance qcow2_get_refcount() signals an error by returning a > negative value, refcount values are generally signed to be able to > represent those error values correctly. This limits the maximum refcount > value supported by qemu to INT64_MAX (=3D 63 bits), as established in > "qcow2: Add two new fields to BDRVQcowState". >=20 > This limitation should have no implications in practice for normal valid > images. If the MSb in a 64 bit refcount value is set, we can safely > assume the value to be invalid (because reaching such high refcounts is > impossible due to other limitations of the qcow2 format). >=20 > Signed-off-by: Max Reitz > Reviewed-by: Eric Blake > --- > block/qcow2-cluster.c | 9 ++++++--- > block/qcow2-refcount.c | 37 ++++++++++++++++++++----------------- > block/qcow2.h | 7 ++++--- > 3 files changed, 30 insertions(+), 23 deletions(-) Reviewed-by: Stefan Hajnoczi --YD3LsXFS42OYHhNZ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUdywBAAoJEJykq7OBq3PI1G8H/Rzejx3rLLXb7fRP5G74HA19 4pGdirdiQz6ovXpQC4htVD1vwWyXmrpfPrNCihCGah9i1i8a/plLDh/f4SvOo6Kh CbtwNuvnwVBsVH/cs4dR3J+sltYgfjr9/2SUHjWBV1bLG+dyMh6OsH3aCrSGGhuq slHsxt513hGsULBlqOD3tKPqo1LD7TzN6t9n+6ttO5676wR6obo8ZAdhm9WwG3ql KOt8SyCsuY7K4UFl0jVmi1WelY2pCqPI+vxorq4OslqidhhdxQyYt1ipMFYDr8Oj Nwd5zCEzwWT3gs1atxvRZSjRKRFXECHdfgpmVJGgAzNhhGsmXNWpQu17rZyHOMI= =1DtY -----END PGP SIGNATURE----- --YD3LsXFS42OYHhNZ--