Re: [Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-04-01 Thread Markus Armbruster
Kevin Wolf writes: > Am 31.03.2015 um 22:46 hat Markus Armbruster geschrieben: >> Kevin Wolf writes: >> >> > Am 26.03.2015 um 16:04 hat Eric Blake geschrieben: >> >> On 03/26/2015 07:18 AM, Markus Armbruster wrote: >> >> > Eric Blake writes: >> >> >> Meanwhile, it would be

Re: [Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-04-01 Thread Kevin Wolf
Am 31.03.2015 um 22:46 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Am 26.03.2015 um 16:04 hat Eric Blake geschrieben: > >> On 03/26/2015 07:18 AM, Markus Armbruster wrote: > >> > Eric Blake writes: > >> >> Meanwhile, it would be nice to allow > >> >> 'discri

Re: [Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-03-31 Thread Eric Blake
On 03/30/2015 04:45 PM, Eric Blake wrote: > On 03/26/2015 09:58 AM, Markus Armbruster wrote: > /home/armbru/work/qemu/.git/rebase-apply/patch:325: new blank line at EOF. >>> >>> Huh. I thought I had git set up to reject me from making commits like >>> that locally, but obviously not. >> >> Th

Re: [Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-03-31 Thread Markus Armbruster
Kevin Wolf writes: > Am 26.03.2015 um 16:04 hat Eric Blake geschrieben: >> On 03/26/2015 07:18 AM, Markus Armbruster wrote: >> > Eric Blake writes: >> >> Meanwhile, it would be nice to allow >> >> 'discriminator':'EnumType' without 'base' for creating a simple union >> >> tha

Re: [Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-03-31 Thread Eric Blake
On 03/31/2015 12:15 PM, Eric Blake wrote: >>> Cool. Or more concretely, >>> >>> { 'union': 'Simple', 'data': { 'one': 'str', 'two': 'int' } } >>> >>> is identical on the wire to: >>> >>> { 'enum': 'MyEnum', 'data': ['one', 'two'] } >>> { 'type': 'Base', 'data': { 'type': 'MyEnum' } } >>> { 'type'

Re: [Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-03-31 Thread Kevin Wolf
Am 31.03.2015 um 20:15 hat Eric Blake geschrieben: > On 03/31/2015 11:13 AM, Kevin Wolf wrote: > > >> [3] > >> { 'union':'SimpleAndSafe', 'discriminator':'MyEnum', > >> 'data':{ 'one':'str', 'two':'int' }} > >> > >> {"execute":"foo", "arguments":{'type':'one', 'data':'hello'}} > > > > This woul

Re: [Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-03-31 Thread Eric Blake
On 03/31/2015 11:13 AM, Kevin Wolf wrote: >> [3] >> { 'union':'SimpleAndSafe', 'discriminator':'MyEnum', >> 'data':{ 'one':'str', 'two':'int' }} >> >> {"execute":"foo", "arguments":{'type':'one', 'data':'hello'}} > > This would overload 'discriminator' with two different meanings: > > * In cas

Re: [Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-03-31 Thread Kevin Wolf
Am 26.03.2015 um 16:04 hat Eric Blake geschrieben: > On 03/26/2015 07:18 AM, Markus Armbruster wrote: > > Eric Blake writes: > >> Meanwhile, it would be nice to allow > >> 'discriminator':'EnumType' without 'base' for creating a simple union > >> that is type-safe rather than o

Re: [Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-03-30 Thread Eric Blake
On 03/26/2015 09:58 AM, Markus Armbruster wrote: >>> /home/armbru/work/qemu/.git/rebase-apply/patch:325: new blank line at EOF. >> >> Huh. I thought I had git set up to reject me from making commits like >> that locally, but obviously not. > > There's another one in PATCH 13: > > /home/armbru/wo

Re: [Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-03-27 Thread Eric Blake
On 03/27/2015 06:30 AM, Markus Armbruster wrote: > Eric Blake writes: > >> On 03/26/2015 07:18 AM, Markus Armbruster wrote: >>> Eric Blake writes: >>> Demonstrate that the qapi generator doesn't deal well with unions that aren't up to par. Later patches will update the expected re

Re: [Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-03-27 Thread Markus Armbruster
Eric Blake writes: > On 03/26/2015 07:18 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> Demonstrate that the qapi generator doesn't deal well with unions >>> that aren't up to par. Later patches will update the expected >>> reseults as the generator is made stricter. >>> >>> Of parti

Re: [Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-03-26 Thread Markus Armbruster
Eric Blake writes: > On 03/26/2015 07:23 AM, Markus Armbruster wrote: >> One more: >> >> [...] >>> diff --git a/tests/qapi-schema/alternate-conflict-string.json >>> b/tests/qapi-schema/alternate-conflict-string.json >>> new file mode 100644 >>> index 000..5fd1a47 >>> --- /dev/null >>> +++ b/

Re: [Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-03-26 Thread Eric Blake
On 03/26/2015 07:18 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Demonstrate that the qapi generator doesn't deal well with unions >> that aren't up to par. Later patches will update the expected >> reseults as the generator is made stricter. >> >> Of particular note, we currently allow

Re: [Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-03-26 Thread Eric Blake
On 03/26/2015 07:23 AM, Markus Armbruster wrote: > One more: > > [...] >> diff --git a/tests/qapi-schema/alternate-conflict-string.json >> b/tests/qapi-schema/alternate-conflict-string.json >> new file mode 100644 >> index 000..5fd1a47 >> --- /dev/null >> +++ b/tests/qapi-schema/alternate-con

Re: [Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-03-26 Thread Markus Armbruster
One more: [...] > diff --git a/tests/qapi-schema/alternate-conflict-string.json > b/tests/qapi-schema/alternate-conflict-string.json > new file mode 100644 > index 000..5fd1a47 > --- /dev/null > +++ b/tests/qapi-schema/alternate-conflict-string.json > @@ -0,0 +1,8 @@ > +# FIXME: we should rej

Re: [Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-03-26 Thread Markus Armbruster
Eric Blake writes: > Demonstrate that the qapi generator doesn't deal well with unions > that aren't up to par. Later patches will update the expected > reseults as the generator is made stricter. > > Of particular note, we currently allow 'base' without 'discriminator' > as a way to create a sim

[Qemu-devel] [PATCH v5 06/28] qapi: Add some union tests

2015-03-24 Thread Eric Blake
Demonstrate that the qapi generator doesn't deal well with unions that aren't up to par. Later patches will update the expected reseults as the generator is made stricter. Of particular note, we currently allow 'base' without 'discriminator' as a way to create a simple union with a base class. Ho