Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-23 Thread Markus Armbruster
Peter Maydell writes: > On Tue, 23 Feb 2021 at 09:33, Markus Armbruster wrote: >> Misunderstanding: our JSON interpolation feature is *not* string >> interpolation! It interpolates *objects* into the QObject built by the >> parser. > > Given that it's basically undocumented except in a

Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-23 Thread Markus Armbruster
Paolo Bonzini writes: > On 23/02/21 10:06, Markus Armbruster wrote: >>> Markus, did you rebuild the qtests after disabling single-quoted >>> strings? "make check-qtest-x86_64" would have rebuilt them, but I'm >>> confused by the results. >> I ran "make check" and looked at the failures: >>

Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-23 Thread Peter Maydell
On Tue, 23 Feb 2021 at 09:33, Markus Armbruster wrote: > Misunderstanding: our JSON interpolation feature is *not* string > interpolation! It interpolates *objects* into the QObject built by the > parser. Given that it's basically undocumented except in a scattered handful of comments inside

Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-23 Thread Paolo Bonzini
On 23/02/21 10:06, Markus Armbruster wrote: Markus, did you rebuild the qtests after disabling single-quoted strings? "make check-qtest-x86_64" would have rebuilt them, but I'm confused by the results. I ran "make check" and looked at the failures: Still confused? Yes. What's the patch

Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-23 Thread Markus Armbruster
Markus Armbruster writes: [...] > A bigger stumbling block for replacement is our need for a streaming > interface: we feed the parser characters, and expect to be called back > when an expression is complete. Another stumbling block: check-qjson.c test case "/literals/string/utf8" and

Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-23 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Mon, Feb 22, 2021 at 06:47:30PM +0100, Paolo Bonzini wrote: >> On 22/02/21 16:24, Daniel P. Berrangé wrote: >> > This problem isn't unique to QEMU. Any app using JSON from the >> > shell will have the tedium of quote escaping. JSON is incredibly >> > widespread

Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-23 Thread Markus Armbruster
Paolo Bonzini writes: > On 22/02/21 16:24, Daniel P. Berrangé wrote: >> This problem isn't unique to QEMU. Any app using JSON from the >> shell will have the tedium of quote escaping. JSON is incredibly >> widespread and no other apps felt it neccessary to introduce single >> quoting support,

Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-22 Thread Peter Krempa
On Mon, Feb 22, 2021 at 19:22:49 +0100, Peter Krempa wrote: > On Mon, Feb 22, 2021 at 18:42:00 +0100, Paolo Bonzini wrote: > > On 22/02/21 15:57, Markus Armbruster wrote: > > > * The block layer's pseudo-protocol "json:" (which can get embedded in > > >image headers) > > > > If it gets

Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-22 Thread Peter Krempa
On Mon, Feb 22, 2021 at 18:42:00 +0100, Paolo Bonzini wrote: > On 22/02/21 15:57, Markus Armbruster wrote: > > * The block layer's pseudo-protocol "json:" (which can get embedded in > >image headers) > > If it gets embedded in image headers, I don't think we'll be able to > deprecate it ever.

Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-22 Thread Paolo Bonzini
On 22/02/21 18:54, Daniel P. Berrangé wrote: These are sent to QEMU as double-quoted strings (the single-quoted JSON is parsed to get interpolation and printed back; commit 563890c7c7, "libqtest: escape strings in QMP commands, fix leak", 2014-07-01). However, doing the interpolation requires a

Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-22 Thread Daniel P . Berrangé
On Mon, Feb 22, 2021 at 06:42:00PM +0100, Paolo Bonzini wrote: > On 22/02/21 15:57, Markus Armbruster wrote: > > * The block layer's pseudo-protocol "json:" (which can get embedded in > >image headers) > > If it gets embedded in image headers, I don't think we'll be able to > deprecate it

Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-22 Thread Daniel P . Berrangé
On Mon, Feb 22, 2021 at 06:47:30PM +0100, Paolo Bonzini wrote: > On 22/02/21 16:24, Daniel P. Berrangé wrote: > > This problem isn't unique to QEMU. Any app using JSON from the > > shell will have the tedium of quote escaping. JSON is incredibly > > widespread and no other apps felt it neccessary

Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-22 Thread Paolo Bonzini
On 22/02/21 16:24, Daniel P. Berrangé wrote: This problem isn't unique to QEMU. Any app using JSON from the shell will have the tedium of quote escaping. JSON is incredibly widespread and no other apps felt it neccessary to introduce single quoting support, because the benefit doesn't outweigh

Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-22 Thread Paolo Bonzini
On 22/02/21 15:57, Markus Armbruster wrote: * The block layer's pseudo-protocol "json:" (which can get embedded in image headers) If it gets embedded in image headers, I don't think we'll be able to deprecate it ever. We'd need to keep a converter for old images, at which point it's

Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-22 Thread Liviu Ionescu
On Mon, 22 Feb 2021 at 17:27, Daniel P. Berrangé wrote: > > IMHO we should deprecate and eventually remove single quotes +1 If a JSON cannot be directly processed by the standard JavaScript parser, it should not be used. Regards, Liviu -- Sent from my iPad via Gmail.

Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-22 Thread Daniel P . Berrangé
On Mon, Feb 22, 2021 at 03:57:22PM +0100, Markus Armbruster wrote: > We use JSON in several external interfaces: > > * QMP > > * The guest agent's QMP > > * QAPIfied command line options when the option argument starts with > '{' > > * The block layer's pseudo-protocol "json:" (which can get

Re: A brief look at deprecating our JSON extensions over RFC 8259

2021-02-22 Thread Peter Krempa
On Mon, Feb 22, 2021 at 15:57:22 +0100, Markus Armbruster wrote: > We use JSON in several external interfaces: > > * QMP > > * The guest agent's QMP > > * QAPIfied command line options when the option argument starts with > '{' > > * The block layer's pseudo-protocol "json:" (which can get

A brief look at deprecating our JSON extensions over RFC 8259

2021-02-22 Thread Markus Armbruster
We use JSON in several external interfaces: * QMP * The guest agent's QMP * QAPIfied command line options when the option argument starts with '{' * The block layer's pseudo-protocol "json:" (which can get embedded in image headers) I *think* that's all. The JSON parser we use for these