From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwEz3-0007Jz-1X for qemu-devel@nongnu.org; Wed, 03 Dec 2014 13:49:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XwEyx-0001Fp-RQ for qemu-devel@nongnu.org; Wed, 03 Dec 2014 13:49:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwEyx-0001Fk-JY for qemu-devel@nongnu.org; Wed, 03 Dec 2014 13:48:59 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sB3ImvX8004783 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 3 Dec 2014 13:48:57 -0500 Message-ID: <547F5B18.5020500@redhat.com> Date: Wed, 03 Dec 2014 11:48:56 -0700 From: Eric Blake MIME-Version: 1.0 References: <1417613866-25890-1-git-send-email-mreitz@redhat.com> <1417613866-25890-11-git-send-email-mreitz@redhat.com> In-Reply-To: <1417613866-25890-11-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="83qddqUNHpGeknaHMWHak8D9EqVgBRmL8" Subject: Re: [Qemu-devel] [PATCH v4 10/26] 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) --83qddqUNHpGeknaHMWHak8D9EqVgBRmL8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/03/2014 06:37 AM, 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 | 122 ++++++++++++++++++++++++++++-------------= -------- > block/qcow2.h | 8 ++++ > 2 files changed, 79 insertions(+), 51 deletions(-) >=20 Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --83qddqUNHpGeknaHMWHak8D9EqVgBRmL8 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 iQEcBAEBCAAGBQJUf1sYAAoJEKeha0olJ0NqFiQH/1NrMZcdrKPYFmzO0bBgO+hK lLG0ruwjoQZ3upvGHa6OqsJk1Pi5ybBahUVnZNLLiLpwl7xsFjkuX9ftvYU/qVjU wqIHWzz2m5wCjl92kTsUIeQUxZZpp7j86yELs8qjOwZNgDWB+4M4IM5bKW2LsufL HZjA6CmqLe+iuJ90DLPV88dsoFNn4+3ZpcpDOk66j4b0dwwwS8w0Ni1NXr6a3oqI z/r4gUz+OoLZAgiOqz91pJUxdqzNPgcbqen7QrQbqn6BXssH9Z+cMzraInQDXM6G lzAzkI5yW6Ak+Kb5g8PkIMoreaDejIE24+cQ8m/TrSRDvtqH3pynfvjF7thlcBI= =dOPJ -----END PGP SIGNATURE----- --83qddqUNHpGeknaHMWHak8D9EqVgBRmL8--