From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aB3Iu-0007e9-Ce for qemu-devel@nongnu.org; Mon, 21 Dec 2015 11:27:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aB3Ir-0004ND-71 for qemu-devel@nongnu.org; Mon, 21 Dec 2015 11:27:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aB3Iq-0004N4-S5 for qemu-devel@nongnu.org; Mon, 21 Dec 2015 11:27:17 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 627C88CF43 for ; Mon, 21 Dec 2015 16:27:16 +0000 (UTC) References: <1450714014-16849-1-git-send-email-berrange@redhat.com> <1450714014-16849-4-git-send-email-berrange@redhat.com> From: Eric Blake Message-ID: <56782863.9020203@redhat.com> Date: Mon, 21 Dec 2015 09:27:15 -0700 MIME-Version: 1.0 In-Reply-To: <1450714014-16849-4-git-send-email-berrange@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="iWlEsox2GGp6gRcohlFXXwCSUsBvBrJem" Subject: Re: [Qemu-devel] [PATCH 3/6] crypto: move QCryptoHashAlgorithm enum definition into QAPI List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , qemu-devel@nongnu.org Cc: Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --iWlEsox2GGp6gRcohlFXXwCSUsBvBrJem Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/21/2015 09:06 AM, Daniel P. Berrange wrote: > The QCryptoHashAlgorithm enum is defined in the crypto/hash.h > header. In the future some QAPI types will want to reference > the hash enums, so move the enum definition into QAPI too. >=20 > Signed-off-by: Daniel P. Berrange > --- > crypto/hash.c | 4 ++-- > include/crypto/hash.h | 9 +-------- > qapi/crypto.json | 15 +++++++++++++++ > 3 files changed, 18 insertions(+), 10 deletions(-) >=20 > diff --git a/crypto/hash.c b/crypto/hash.c > index 5a47b90..b5f81c4 100644 > --- a/crypto/hash.c > +++ b/crypto/hash.c > @@ -24,13 +24,13 @@ > #include > #include > =20 > -static int qcrypto_hash_alg_map[QCRYPTO_HASH_ALG_LAST] =3D { > +static int qcrypto_hash_alg_map[QCRYPTO_HASH_ALG_MAX] =3D { Will need rebasing, now that commit 7fb1cf1 has landed and renamed it QCRYPTO_HASH_ALG__MAX. > +++ b/qapi/crypto.json > @@ -33,3 +33,18 @@ > { 'enum': 'QCryptoSecretFormat', > 'prefix': 'QCRYPTO_SECRET_FORMAT', > 'data': ['raw', 'base64']} > + > + > +## > +# QCryptoHashAlgorithm: > +# > +# The supported algorithms for computing content digests > +# > +# @md5: MD5. Should not be used in any new code, legacy compat only > +# @sha1: SHA-1. Should not be used in any new code, legacy compat only= > +# @sha256: SHA-256. Current recommended strong hash. > +# Since: 2.6 > +## > +{ 'enum': 'QCryptoHashAlgorithm', > + 'prefix': 'QCRYPTO_HASH_ALG', > + 'data': ['md5', 'sha1', 'sha256']} Otherwise looks fine. I know Markus is debating about getting rid of use of 'prefix', and this just makes that task harder, but the current munging would produce Q_CRYPTO_... even if you named the enum QCryptoHashAlg, so I'm okay with it. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --iWlEsox2GGp6gRcohlFXXwCSUsBvBrJem 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWeChjAAoJEKeha0olJ0Nqv8MH/1sANH/vxy/nIWSweKeknDmo uYYe05anpfOeGCqpy9WUe7GfiXPr2ivm7Nq6UcTjDVufKFnVUUOuP4iqyYZs6iB5 c/LSn4RKn/ReYZQOGMMUppvsAxE0Rsi0gbkTNUbWZPe4h80ArGl0raW0XSSpc9Z7 Kj8d+PCu3Dh0kota4Uw/hIQOdcp9gVBAe1z0oCcfcdWv5bRbQCW/EAAnq1pRd2xx PMOjUe47j9C1yNUZok+Lv8WnmilYFj7tSldqjlBflKmdbfD5LpPnFGvdT6lDjLR4 Rpf3lWkeode3JS1GKeIYTbMnqKvve7j/NWvyLq6qpIqPxxFh2+0gj+K8C/j7fxs= =fxNG -----END PGP SIGNATURE----- --iWlEsox2GGp6gRcohlFXXwCSUsBvBrJem--