Re: [PATCH 06/12] qapi/source: Add builtin null-object sentinel

2020-12-18 Thread John Snow
On 12/17/20 6:56 AM, Markus Armbruster wrote: John Snow writes: On 12/16/20 4:22 AM, Markus Armbruster wrote: 2. On error with "no source info", don't crash. I have my doubts on this one. Such an error means the QAPI code generator screwed up, at least in theory. Crashing is o

Re: [PATCH 06/12] qapi/source: Add builtin null-object sentinel

2020-12-18 Thread John Snow
On 12/17/20 7:33 AM, Markus Armbruster wrote: A patch limited to the first aspect merely tweaks an implementation detail. As soon as we include the second aspect, we get to debate how to handle programming errors, and maybe whether any of the errors involving a QAPISourceInfo.builtin() are*not*

Re: [PATCH 06/12] qapi/source: Add builtin null-object sentinel

2020-12-17 Thread Markus Armbruster
John Snow writes: > On 12/16/20 4:22 AM, Markus Armbruster wrote: >> John Snow writes: >> >>> We use None to represent an object that has no source information >>> because it's a builtin. This complicates interface typing, since many >>> interfaces expect that there is an info object available

Re: [PATCH 06/12] qapi/source: Add builtin null-object sentinel

2020-12-17 Thread Markus Armbruster
John Snow writes: > On 12/16/20 4:22 AM, Markus Armbruster wrote: >> 2. On error with "no source info", don't crash. >> I have my doubts on this one. >> Such an error means the QAPI code generator screwed up, at least >> in >> theory. Crashing is only proper. It gets the screwup fix

Re: [PATCH 06/12] qapi/source: Add builtin null-object sentinel

2020-12-16 Thread John Snow
On 12/16/20 4:22 AM, Markus Armbruster wrote: 2. On error with "no source info", don't crash. I have my doubts on this one. Such an error means the QAPI code generator screwed up, at least in theory. Crashing is only proper. It gets the screwup fixed. QAPISemError and friends w

Re: [PATCH 06/12] qapi/source: Add builtin null-object sentinel

2020-12-16 Thread John Snow
On 12/16/20 4:22 AM, Markus Armbruster wrote: John Snow writes: We use None to represent an object that has no source information because it's a builtin. This complicates interface typing, since many interfaces expect that there is an info object available to print errors with. Introduce a sp

Re: [PATCH 06/12] qapi/source: Add builtin null-object sentinel

2020-12-16 Thread Markus Armbruster
John Snow writes: > We use None to represent an object that has no source information > because it's a builtin. This complicates interface typing, since many > interfaces expect that there is an info object available to print errors > with. > > Introduce a special QAPISourceInfo that represents t

[PATCH 06/12] qapi/source: Add builtin null-object sentinel

2020-12-14 Thread John Snow
We use None to represent an object that has no source information because it's a builtin. This complicates interface typing, since many interfaces expect that there is an info object available to print errors with. Introduce a special QAPISourceInfo that represents these built-ins so that if an er