From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF0qd-0004Cd-3S for qemu-devel@nongnu.org; Mon, 20 Jun 2016 11:10:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bF0qb-0004Y7-3k for qemu-devel@nongnu.org; Mon, 20 Jun 2016 11:10:47 -0400 References: <1466093177-17890-1-git-send-email-peter.maydell@linaro.org> From: Max Reitz Message-ID: <34c3863f-cf4f-2bf6-20cb-92b4711ad4d9@redhat.com> Date: Mon, 20 Jun 2016 17:10:29 +0200 MIME-Version: 1.0 In-Reply-To: <1466093177-17890-1-git-send-email-peter.maydell@linaro.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TSUniU7CaOerkDPoU8VOs6svcsh9PShnO" Subject: Re: [Qemu-devel] [PATCH] block/qcow2: Don't use cpu_to_*w() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: patches@linaro.org, Kevin Wolf , qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --TSUniU7CaOerkDPoU8VOs6svcsh9PShnO From: Max Reitz To: Peter Maydell , qemu-devel@nongnu.org Cc: patches@linaro.org, Kevin Wolf , qemu-block@nongnu.org Message-ID: <34c3863f-cf4f-2bf6-20cb-92b4711ad4d9@redhat.com> Subject: Re: [PATCH] block/qcow2: Don't use cpu_to_*w() References: <1466093177-17890-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1466093177-17890-1-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 16.06.2016 18:06, Peter Maydell wrote: > Don't use the cpu_to_*w() functions, which we are trying to deprecate. > Instead either just use cpu_to_*() to do the byteswap, or use > st*_be_p() if we need to do the store somewhere other than to a > variable that's already the correct type. >=20 > Signed-off-by: Peter Maydell > --- > block/qcow2-cluster.c | 2 +- > block/qcow2-refcount.c | 11 +++++------ > block/qcow2.c | 6 +++--- > 3 files changed, 9 insertions(+), 10 deletions(-) > [...] > diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c > index 66f187a..088c00f 100644 > --- a/block/qcow2-refcount.c > +++ b/block/qcow2-refcount.c > @@ -565,8 +565,8 @@ static int alloc_refcount_block(BlockDriverState *b= s, > uint64_t d64; > uint32_t d32; > } data; This declaration is in the middle of the block, so it might have made sense to fix that along the way. Since this is pre-existing, however: Thanks, applied to my block tree: https://github.com/XanClic/qemu/commits/block Max > - cpu_to_be64w(&data.d64, table_offset); > - cpu_to_be32w(&data.d32, table_clusters); > + data.d64 =3D cpu_to_be64(table_offset); > + data.d32 =3D cpu_to_be32(table_clusters); > BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_ALLOC_SWITCH_TABLE); > ret =3D bdrv_pwrite_sync(bs->file->bs, > offsetof(QCowHeader, refcount_table_offset)= , --TSUniU7CaOerkDPoU8VOs6svcsh9PShnO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXaAdlAAoJEDuxQgLoOKyt6/QIAKysF0TynjqNhQnt9pgL+ifq N+iuYmBWAoyX11GKTwViqrn5NBHEyoqxF1poHzZfxSX5d+dODkES9QuXzYV938+7 UIEq+yGI8N+W44aPLS0fyUMBYRimFV7E8WIGB5GZnJLaCCljp/pbVijcASWw5NN5 lR0DryzN98JKc/jfhdFoK1vT01RiJwnNmFg4cAAIzb50SPflAFDMZ/8XOKX3nASS utnKNJNDpsY1VYcO6pDEpEObBU2g1vLwF6kqqXik+fbLLLlf9bA9sQ3ENzW+/cGv FgQhse6uBmjIMlM6y0bgut2w6mFvwfX0LAdrg7f+0CNQsE031/tRyHlvK1GDJY0= =nKpZ -----END PGP SIGNATURE----- --TSUniU7CaOerkDPoU8VOs6svcsh9PShnO--