qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Paolo Bonzini
Subject: Re: [Qemu-devel] RFC: libyajl for JSON
Date: Tue, 3 Nov 2015 15:53:34 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


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

    qmp_discard_response("{'execute':'change', 'arguments':{"
                         " 'device':'floppy0', 'target': %s, 'arg': 'raw' }}",

versus

    qmp_discard_response("{\"execute\":\"change\", \"arguments\":{"
                         " \"device\":\"floppy0\", \"target\": %s, \"arg\": 
\"raw\" }}",


> > 2) waste time finding a replacement for % interpolation (the best
> > replacement here would be to rewrite the tests in Python IMHO, but
> > that's not a small ask)
> 
> Is this only used by tests? Can you give an example of this feature?

See above.  Notice how the %s becomes a JSON string, with automatic
backslash escaping.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]