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

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

2018-05-18 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

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

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

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

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

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

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

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

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 -- >

[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