From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUa7r-0003dE-PU for qemu-devel@nongnu.org; Wed, 26 Aug 2015 08:48:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUa7n-0008FW-LM for qemu-devel@nongnu.org; Wed, 26 Aug 2015 08:48:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUa7n-0008FJ-Fk for qemu-devel@nongnu.org; Wed, 26 Aug 2015 08:48:19 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id B2BE7461C4 for ; Wed, 26 Aug 2015 12:48:18 +0000 (UTC) Date: Wed, 26 Aug 2015 13:48:14 +0100 From: "Daniel P. Berrange" Message-ID: <20150826124739.GK21787@redhat.com> References: <1440425695-24286-1-git-send-email-berrange@redhat.com> <1440425695-24286-2-git-send-email-berrange@redhat.com> <55DB7DB4.30907@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <55DB7DB4.30907@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 1/7] crypto: introduce new base module for TLS credentials Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Paolo Bonzini , qemu-devel@nongnu.org, Gerd Hoffmann On Mon, Aug 24, 2015 at 02:25:24PM -0600, Eric Blake wrote: > > +/* #define QCRYPTO_DEBUG */ > > + > > +#ifdef QCRYPTO_DEBUG > > +#define DPRINTF(fmt, ...) do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0) > > +#else > > +#define DPRINTF(fmt, ...) do { } while (0) > > +#endif > > Please rework this to: > > #ifdef QCRYPTO_DEBUG > # define QCRYPT_DEBUG_PRINT 1 > #else > # define QCRYPT_DEBUG_PRINT 0 > #endif > #define DPRINTF(fmt, ...) \ > do { \ > if (QCRYPT_DEBUG_PRINT) { \ > fprintf(stderr, fmt, ## __VA_ARGS__); \ > } \ > } while (0) Ah that's a good idea. One day it would nice if QEMU had a standardized debug logging macro in qemu-common.h, so we could just turn on/off debugging per file using #define ENABLE_DEBUG 1 #include "qemu-common.h" > > +#define DH_BITS 2048 > > + > > +static const char * const endpoint_map[QCRYPTO_TLS_CREDS_ENDPOINT_LAST + 1] = { > > + [QCRYPTO_TLS_CREDS_ENDPOINT_SERVER] = "server", > > + [QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT] = "client", > > + [QCRYPTO_TLS_CREDS_ENDPOINT_LAST] = NULL, > > +}; > > Is it worth an entry in a .json file to get qapi to generate this > mapping automatically? I guess adding the enum definition itself to QAPI would mean we would get better introspection support when we solve QOM class introspection of properties. 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 :|