From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsO7g-0005Oy-5C for qemu-devel@nongnu.org; Sun, 15 Dec 2013 21:41:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsO7T-0002Mx-4C for qemu-devel@nongnu.org; Sun, 15 Dec 2013 21:41:32 -0500 Received: from e28smtp06.in.ibm.com ([122.248.162.6]:42539) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsO7S-0002Mh-Fh for qemu-devel@nongnu.org; Sun, 15 Dec 2013 21:41:19 -0500 Received: from /spool/local by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 16 Dec 2013 08:11:14 +0530 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 1140AE0053 for ; Mon, 16 Dec 2013 08:13:35 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rBG2f9Js40829092 for ; Mon, 16 Dec 2013 08:11:09 +0530 Received: from d28av01.in.ibm.com (localhost [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rBG2fAGZ017374 for ; Mon, 16 Dec 2013 08:11:10 +0530 Message-ID: <52AE6849.9080805@linux.vnet.ibm.com> Date: Mon, 16 Dec 2013 10:41:13 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1386740912-1655-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1386740912-1655-9-git-send-email-xiawenc@linux.vnet.ibm.com> <52AB9D32.2090500@redhat.com> In-Reply-To: <52AB9D32.2090500@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V4 8/9] qapi: convert BlockdevOptions to use enum discriminator List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: kwolf@redhat.com, mdroth@linux.vnet.ibm.com, armbru@redhat.com, lcapitulino@redhat.com 于 2013/12/14 7:50, Eric Blake 写道: > On 12/10/2013 10:48 PM, Wenchao Xia wrote: >> After this patch, hidden enum type BlockdevOptionsKind will not >> be generated, and other API can use enum BlockdevDriver. >> >> Signed-off-by: Wenchao Xia >> Reviewed-by: Eric Blake >> --- >> qapi-schema.json | 14 +++++++++++++- >> 1 files changed, 13 insertions(+), 1 deletions(-) > > You know, it might even be better if we just flat out require that ALL > discriminated unions use an enum type, and discontinue support for > open-coded string (with hidden enum generation). The extra type safety > and potential for introspection that it buys us is worth the change. I > don't know how much of your series that would affect, but it's food for > thought. > I thought that before, and it is not hard to do, just need people's confirm that, string discriminator is not needed any more.