[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V4 8/9] qapi: convert BlockdevOptions to use enu
From: |
Luiz Capitulino |
Subject: |
Re: [Qemu-devel] [PATCH V4 8/9] qapi: convert BlockdevOptions to use enum discriminator |
Date: |
Mon, 16 Dec 2013 16:26:57 -0500 |
On Mon, 16 Dec 2013 10:41:13 +0800
Wenchao Xia <address@hidden> wrote:
> δΊ 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 <address@hidden>
> >> Reviewed-by: Eric Blake <address@hidden>
> >> ---
> >> 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.
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).
- [Qemu-devel] [PATCH V4 2/9] qapi script: add check for duplicated key, (continued)
- [Qemu-devel] [PATCH V4 2/9] qapi script: add check for duplicated key, Wenchao Xia, 2013/12/11
- [Qemu-devel] [PATCH V4 5/9] qapi script: use same function to generate enum string, Wenchao Xia, 2013/12/11
- [Qemu-devel] [PATCH V4 1/9] qapi script: remember enum values, Wenchao Xia, 2013/12/11
- [Qemu-devel] [PATCH V4 4/9] qapi script: code move for generate_enum_name(), Wenchao Xia, 2013/12/11
- [Qemu-devel] [PATCH V4 9/9] qapi script: do not add "_" for every capitalized char in enum, Wenchao Xia, 2013/12/11
- [Qemu-devel] [PATCH V4 8/9] qapi: convert BlockdevOptions to use enum discriminator, Wenchao Xia, 2013/12/11
- [Qemu-devel] [PATCH V4 7/9] tests: add cases for inherited struct and union with discriminator, Wenchao Xia, 2013/12/11
- [Qemu-devel] [PATCH V4 3/9] qapi script: check correctness of discriminator values in union, Wenchao Xia, 2013/12/11