From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vsfgy-0004i5-So for qemu-devel@nongnu.org; Mon, 16 Dec 2013 16:27:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vsfgs-0005GH-TM for qemu-devel@nongnu.org; Mon, 16 Dec 2013 16:27:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vsfgs-0005FN-Jg for qemu-devel@nongnu.org; Mon, 16 Dec 2013 16:27:02 -0500 Date: Mon, 16 Dec 2013 16:26:57 -0500 From: Luiz Capitulino Message-ID: <20131216162657.3b4984a9@redhat.com> In-Reply-To: <52AE6849.9080805@linux.vnet.ibm.com> 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> <52AE6849.9080805@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Wenchao Xia Cc: kwolf@redhat.com, Stefan Hajnoczi , mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org, armbru@redhat.com On Mon, 16 Dec 2013 10:41:13 +0800 Wenchao Xia wrote: > =E4=BA=8E 2013/12/14 7:50, Eric Blake =E5=86=99=E9=81=93: > > 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. > > >=20 > I thought that before, and it is not hard to do, just need > people's confirm that, string discriminator is not needed any more. I think this feature is mainly used by the block layer, so could someone from the block layer confirm this? Also, this series looks ok to me, but it would be good to get an ACK from someone from the block layer before applying (at least to this patch).