From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBPCo-0005Ju-9S for qemu-devel@nongnu.org; Tue, 22 Dec 2015 10:50:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBPCk-00071E-Ur for qemu-devel@nongnu.org; Tue, 22 Dec 2015 10:50:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBPCk-00070w-Pu for qemu-devel@nongnu.org; Tue, 22 Dec 2015 10:50:26 -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 (Postfix) with ESMTPS id CDC8C7D for ; Tue, 22 Dec 2015 15:50:25 +0000 (UTC) Date: Tue, 22 Dec 2015 15:50:22 +0000 From: "Daniel P. Berrange" Message-ID: <20151222155022.GG10082@redhat.com> References: <1450714014-16849-1-git-send-email-berrange@redhat.com> <1450714014-16849-4-git-send-email-berrange@redhat.com> <56782863.9020203@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <56782863.9020203@redhat.com> Subject: Re: [Qemu-devel] [PATCH 3/6] crypto: move QCryptoHashAlgorithm enum definition into QAPI Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, Markus Armbruster On Mon, Dec 21, 2015 at 09:27:15AM -0700, Eric Blake wrote: > 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. > > > > 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(-) > > > > 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 > > > > -static int qcrypto_hash_alg_map[QCRYPTO_HASH_ALG_LAST] = { > > +static int qcrypto_hash_alg_map[QCRYPTO_HASH_ALG_MAX] = { > > 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. If we do decide to kill "prefix" I'm happy to help cleanup the fallout, since its all in code I've added... > Reviewed-by: Eric Blake Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|