Re: [Qemu-devel] [PATCH 1/2] qapi: allow flat unions with empty branches

2018-05-18 Thread Anton Nefedov
On 18/5/2018 9:45 AM, Markus Armbruster wrote: Eric Blake writes: On 05/17/2018 03:05 AM, Markus Armbruster wrote: QAPI language design alternatives: 1. Having unions cover all discriminator values explicitly is useful. 2. Having unions repeat all the discriminator values explicitly is

Re: [Qemu-devel] [PATCH 1/2] qapi: allow flat unions with empty branches

2018-05-17 Thread Markus Armbruster
Eric Blake writes: > On 05/17/2018 03:05 AM, Markus Armbruster wrote: QAPI language design alternatives: 1. Having unions cover all discriminator values explicitly is useful. > 2. Having unions repeat all the discriminator values explicitly is not

Re: [Qemu-devel] [PATCH 1/2] qapi: allow flat unions with empty branches

2018-05-17 Thread Eric Blake
On 05/17/2018 03:05 AM, Markus Armbruster wrote: QAPI language design alternatives: 1. Having unions cover all discriminator values explicitly is useful. 2. Having unions repeat all the discriminator values explicitly is not useful. All we need is replacing the code enforcing that by code de

Re: [Qemu-devel] [PATCH 1/2] qapi: allow flat unions with empty branches

2018-05-17 Thread Markus Armbruster
Anton Nefedov writes: > On 15/5/2018 8:40 PM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> On 05/15/2018 02:01 AM, Markus Armbruster wrote: >>> >> QAPI language design alternatives: >> >> 1. Having unions cover all discriminator values explicitly is useful. >>> >> 2. Hav

Re: [Qemu-devel] [PATCH 1/2] qapi: allow flat unions with empty branches

2018-05-16 Thread Anton Nefedov
On 15/5/2018 8:40 PM, Markus Armbruster wrote: Eric Blake writes: On 05/15/2018 02:01 AM, Markus Armbruster wrote: QAPI language design alternatives: 1. Having unions cover all discriminator values explicitly is useful. 2. Having unions repeat all the discriminator values explicitly is

Re: [Qemu-devel] [PATCH 1/2] qapi: allow flat unions with empty branches

2018-05-15 Thread Markus Armbruster
Eric Blake writes: > On 05/15/2018 02:01 AM, Markus Armbruster wrote: > QAPI language design alternatives: 1. Having unions cover all discriminator values explicitly is useful. > 2. Having unions repeat all the discriminator values explicitly is not useful. All we need i

Re: [Qemu-devel] [PATCH 1/2] qapi: allow flat unions with empty branches

2018-05-15 Thread Eric Blake
On 05/15/2018 02:01 AM, Markus Armbruster wrote: QAPI language design alternatives: 1. Having unions cover all discriminator values explicitly is useful. 2. Having unions repeat all the discriminator values explicitly is not useful. All we need is replacing the code enforcing that by code d

Re: [Qemu-devel] [PATCH 1/2] qapi: allow flat unions with empty branches

2018-05-15 Thread Markus Armbruster
Eric Blake writes: > On 05/14/2018 01:08 PM, Markus Armbruster wrote: >> Anton Nefedov writes: >> >>> The patch makes possible to avoid introducing dummy empty types >>> for the flat union branches that have no data. >>> > >> >> Some unions have no variant members for certain discriminator value

Re: [Qemu-devel] [PATCH 1/2] qapi: allow flat unions with empty branches

2018-05-14 Thread Eric Blake
On 05/14/2018 01:08 PM, Markus Armbruster wrote: Anton Nefedov writes: The patch makes possible to avoid introducing dummy empty types for the flat union branches that have no data. Some unions have no variant members for certain discriminator values. We currently have to use an empty typ

Re: [Qemu-devel] [PATCH 1/2] qapi: allow flat unions with empty branches

2018-05-14 Thread Markus Armbruster
Anton Nefedov writes: > The patch makes possible to avoid introducing dummy empty types > for the flat union branches that have no data. > > Signed-off-by: Anton Nefedov > --- > scripts/qapi/common.py | 18 -- > scripts/qapi/doc.py| 2 +- > scripts/qapi/type

[Qemu-devel] [PATCH 1/2] qapi: allow flat unions with empty branches

2018-05-11 Thread Anton Nefedov
The patch makes possible to avoid introducing dummy empty types for the flat union branches that have no data. Signed-off-by: Anton Nefedov --- scripts/qapi/common.py | 18 -- scripts/qapi/doc.py| 2 +- scripts/qapi/types.py | 2 +- scripts/qapi/vis