From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLcBe-0008WJ-BF for qemu-devel@nongnu.org; Wed, 11 Feb 2015 13:38:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLcBb-0005GD-35 for qemu-devel@nongnu.org; Wed, 11 Feb 2015 13:38:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLcBa-0005Fz-Ra for qemu-devel@nongnu.org; Wed, 11 Feb 2015 13:38:55 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1BIcrbQ003178 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 11 Feb 2015 13:38:54 -0500 Message-ID: <54DBA1BC.4000702@redhat.com> Date: Wed, 11 Feb 2015 11:38:52 -0700 From: Eric Blake MIME-Version: 1.0 References: <1423600146-7642-1-git-send-email-mreitz@redhat.com> <1423600146-7642-9-git-send-email-mreitz@redhat.com> In-Reply-To: <1423600146-7642-9-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3vTKnVBBLaJANXU303VESssUFA7bO75bN" Subject: Re: [Qemu-devel] [PATCH v6 08/24] qcow2: Helper function for refcount modification List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3vTKnVBBLaJANXU303VESssUFA7bO75bN Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/10/2015 01:28 PM, Max Reitz wrote: > Since refcounts do not always have to be a uint16_t, all refcount block= s > and arrays in memory should not have a specific type (thus they become > pointers to void) and for accessing them, two helper functions are used= > (a getter and a setter). Those functions are called indirectly through > function pointers in the BDRVQcowState so they may later be exchanged > for different refcount orders. >=20 > With the check and repair functions using this function, the refcount > array they are creating will be in big endian byte order; additionally,= > using realloc_refcount_array() makes the size of this refcount array > always cluster-aligned. Both combined allow rebuild_refcount_structure(= ) > to drop the bounce buffer which was used to convert parts of the > refcount array to big endian byte order and store them on disk. Instead= , > those parts can now be written directly. >=20 > Signed-off-by: Max Reitz > --- > block/qcow2-refcount.c | 126 ++++++++++++++++++++++++++++-------------= -------- > block/qcow2.h | 8 ++++ > 2 files changed, 81 insertions(+), 53 deletions(-) >=20 Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --3vTKnVBBLaJANXU303VESssUFA7bO75bN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJU26G8AAoJEKeha0olJ0NqvNcH/17ZphDRoOMO0x7Fk7kC5REt 13rlqOgJGgU/d24qr5RgPHmfv/09zOGPeY/Xah7PprXExAYdmjZWUfykKpOL0DDe msR11NNJCVxxTIu199Tnx3g9Ys5C4DfW7g+M6DOhzjHt8JLD/1LjxWCqC+bwjWR7 QDq/1gW+6AtgnqdTYx3+qSedjkN2M/31yW17FWoGB4Gp+pcxkXIIDXBvGFpHYNSr 8f2JBeJ+hVi/y/QxKDwHnfTLPJWAkQLsSFdDJfsf5PJsSsvf0QUoyJXaH6bSzAYm I3i7igeL2IgsvUj3TvUBsgGjl6/VmuWrCkvxU/wt/6CjG9ybN76/OQDre+b92uk= =UHf4 -----END PGP SIGNATURE----- --3vTKnVBBLaJANXU303VESssUFA7bO75bN--