From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ypvd2-0007CP-Ti for qemu-devel@nongnu.org; Wed, 06 May 2015 05:28:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ypvcx-0000yf-0s for qemu-devel@nongnu.org; Wed, 06 May 2015 05:28:32 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:45576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ypvcw-0000yZ-N7 for qemu-devel@nongnu.org; Wed, 06 May 2015 05:28:26 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 May 2015 10:28:25 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id CBC5D17D8042 for ; Wed, 6 May 2015 10:29:08 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t469SNuC4129200 for ; Wed, 6 May 2015 09:28:23 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t469SLvS003116 for ; Wed, 6 May 2015 03:28:23 -0600 Date: Wed, 6 May 2015 11:28:17 +0200 From: Michael Mueller Message-ID: <20150506112817.6d6aafb6@bee> In-Reply-To: <20150505144604.GU17796@thinpad.lan.raisama.net> References: <1430146411-34632-1-git-send-email-mimu@linux.vnet.ibm.com> <1430146411-34632-3-git-send-email-mimu@linux.vnet.ibm.com> <20150505132602.GQ17796@thinpad.lan.raisama.net> <5548D57D.7020307@redhat.com> <20150505144604.GU17796@thinpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 02/17] Add accelerator id and model name to CPUState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Cornelia Huck , Gleb Natapov , qemu-devel@nongnu.org, Alexander Graf , Christian Borntraeger , "Jason J. Herne" , Daniel Hansel , Paolo Bonzini , Andreas Faerber , Richard Henderson On Tue, 5 May 2015 11:46:04 -0300 Eduardo Habkost wrote: > On Tue, May 05, 2015 at 08:36:45AM -0600, Eric Blake wrote: > > On 05/05/2015 07:26 AM, Eduardo Habkost wrote: > > >> +{ 'enum': 'AccelId', > > >> + 'data': ['qtest', 'tcg', 'kvm', 'xen'] } > > >> + > > > > > > Not sure if it is better to have an enum or simply a string here. > > > > enum is almost always better when there is a finite set of possible > > strings - it's better documented, and when introspection is in place, > > will make it easier to determine when the set has grown. > > True, and there are other cases where we could use an enum internally in > QEMU (e.g. arrays for accelerator-specific data inside CPU classes). Actually the accelerator name currently represented as string (ac->name = "KVM";) can be initialized from the respective lookup value (AccelId_lookup[]) instead. >