Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-03 Thread Markus Armbruster
Luiz Capitulino writes: > On Tue, 3 Nov 2015 14:53:59 +0100 > Paolo Bonzini wrote: > >> On 03/11/2015 14:46, Luiz Capitulino wrote: >> >> > Can you explain why that would make sense? :) (Especially since there >> >> > is another extension---JSON5---that does exactly what we're doing, so it >> >

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-03 Thread Paolo Bonzini
On 03/11/2015 15:26, Luiz Capitulino wrote: > > 1) uglify all tests and make them inconsistent with the QAPI schemas, > > which also uses single-quoted strings > > This doesn't seem hard to fix, we could pre-process the test files, > say in Python, to add the needed escaping. I'm talking about q

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-03 Thread Luiz Capitulino
On Tue, 3 Nov 2015 14:53:59 +0100 Paolo Bonzini wrote: > On 03/11/2015 14:46, Luiz Capitulino wrote: > >> > Can you explain why that would make sense? :) (Especially since there > >> > is another extension---JSON5---that does exactly what we're doing, so it > >> > probably wasn't that stupid an

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-03 Thread Paolo Bonzini
On 03/11/2015 14:46, Luiz Capitulino wrote: >> > Can you explain why that would make sense? :) (Especially since there >> > is another extension---JSON5---that does exactly what we're doing, so it >> > probably wasn't that stupid an idea). > Let's be pragmatic. *If* this is the only issue stoppi

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-03 Thread Luiz Capitulino
On Tue, 3 Nov 2015 06:40:32 -0700 Eric Blake wrote: > On 11/03/2015 06:19 AM, Luiz Capitulino wrote: > > On Tue, 03 Nov 2015 08:17:58 +0100 > > Markus Armbruster wrote: > > > >>> So at this point, I want to see if lloyd makes any progress towards an > >>> actual yajl release and/or adding a co-

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-03 Thread Luiz Capitulino
On Tue, 3 Nov 2015 14:38:38 +0100 Paolo Bonzini wrote: > > > On 03/11/2015 14:19, Luiz Capitulino wrote: > > > The value proposition of replacing our flawed JSON parser isn't in > > > saving big on maintenance, it's in not having to find and fix its flaws. > > > > > > If the replacement needs

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-03 Thread Daniel P. Berrange
On Tue, Nov 03, 2015 at 06:40:32AM -0700, Eric Blake wrote: > On 11/03/2015 06:19 AM, Luiz Capitulino wrote: > > On Tue, 03 Nov 2015 08:17:58 +0100 > > Markus Armbruster wrote: > > > >>> So at this point, I want to see if lloyd makes any progress towards an > >>> actual yajl release and/or adding

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-03 Thread Eric Blake
On 11/03/2015 06:19 AM, Luiz Capitulino wrote: > On Tue, 03 Nov 2015 08:17:58 +0100 > Markus Armbruster wrote: > >>> So at this point, I want to see if lloyd makes any progress towards an >>> actual yajl release and/or adding a co-maintainer, before even trying to >>> get formal upstream support

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-03 Thread Paolo Bonzini
On 03/11/2015 14:19, Luiz Capitulino wrote: > > The value proposition of replacing our flawed JSON parser isn't in > > saving big on maintenance, it's in not having to find and fix its flaws. > > > > If the replacement needs a lot of work to fit our needs, the value > > proposition becomes negat

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-03 Thread Luiz Capitulino
On Tue, 03 Nov 2015 08:17:58 +0100 Markus Armbruster wrote: > > So at this point, I want to see if lloyd makes any progress towards an > > actual yajl release and/or adding a co-maintainer, before even trying to > > get formal upstream support for single quoting. We could always create > > a git

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-02 Thread Markus Armbruster
Eric Blake writes: > On 11/02/2015 12:10 PM, Markus Armbruster wrote: > * Single-quoted strings > >> >>> So that is an absolute must for whatever parser we choose. My first >>> glance at libyajl is that it does NOT currently allow single quotes (not >>> even with any of its existing option

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-02 Thread Eric Blake
On 11/02/2015 12:10 PM, Markus Armbruster wrote: >>> * Single-quoted strings > >> So that is an absolute must for whatever parser we choose. My first >> glance at libyajl is that it does NOT currently allow single quotes (not >> even with any of its existing options), so we'd have to pre-proces

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-02 Thread Markus Armbruster
Eric Blake writes: > On 11/02/2015 01:40 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> Loaded question in response to >>> https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg06988.html, but >> >> Discussion of our parser's enormous appetite for wasting RAM. Fixable, >> but it

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-02 Thread Eric Blake
On 11/02/2015 01:40 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Loaded question in response to >> https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg06988.html, but > > Discussion of our parser's enormous appetite for wasting RAM. Fixable, > but it's work, and it's not its only

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-02 Thread Stefan Hajnoczi
On Mon, Nov 02, 2015 at 09:40:39AM +0100, Markus Armbruster wrote: > More extensions or pitfalls might be lurking in our parser. Therefore, > replacing our parser by a suitable library is not without risk. I guess > we could do it over a full development cycle. No way for 2.5. Good points. I'm

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-02 Thread Paolo Bonzini
On 02/11/2015 13:56, Markus Armbruster wrote: > A classical parser gets passed a source of characters (string, file > descriptor, whatever), parses until it reaches a terminating state, then > returns an abstract syntax tree (AST). Basically a function mapping a > character source to an AST. >

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-02 Thread Luiz Capitulino
[I thought I had replied to this thread, but it doesn't seem so. So, I'll try again] On Fri, 30 Oct 2015 13:45:48 -0600 Eric Blake wrote: > Loaded question in response to > https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg06988.html, but > posting as a new thread to call attention to i

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-02 Thread Markus Armbruster
Paolo Bonzini writes: > On 02/11/2015 09:40, Markus Armbruster wrote: >> >> * Optional interpolation >> >> If you pass a va_list to the parser, it replaces certain escape >> sequences by values from that va_list. The escape sequences are a >> subset of printf conversion specifiers, to en

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-02 Thread Paolo Bonzini
On 02/11/2015 09:40, Markus Armbruster wrote: > > * Optional interpolation > > If you pass a va_list to the parser, it replaces certain escape > sequences by values from that va_list. The escape sequences are a > subset of printf conversion specifiers, to enable compile-time > checking

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-02 Thread Markus Armbruster
Eric Blake writes: > Loaded question in response to > https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg06988.html, but Discussion of our parser's enormous appetite for wasting RAM. Fixable, but it's work, and it's not its only defect. > posting as a new thread to call attention to it:

Re: [Qemu-devel] RFC: libyajl for JSON

2015-10-30 Thread Peter Maydell
On 30 October 2015 at 19:45, Eric Blake wrote: > Loaded question in response to > https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg06988.html, but > posting as a new thread to call attention to it: > > Libvirt uses libyajl to parse and format JSON. Would it be worth > dragging in yet anoth

[Qemu-devel] RFC: libyajl for JSON

2015-10-30 Thread Eric Blake
Loaded question in response to https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg06988.html, but posting as a new thread to call attention to it: Libvirt uses libyajl to parse and format JSON. Would it be worth dragging in yet another prerequisite library into qemu and reuse libyajl's parse