From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ztcxy-00022f-2S for qemu-devel@nongnu.org; Tue, 03 Nov 2015 09:53:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ztcxu-0004Iz-Sl for qemu-devel@nongnu.org; Tue, 03 Nov 2015 09:53:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ztcxu-0004Ir-NF for qemu-devel@nongnu.org; Tue, 03 Nov 2015 09:53:38 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 62A6CC100440 for ; Tue, 3 Nov 2015 14:53:38 +0000 (UTC) References: <5633C8EC.8030309@redhat.com> <874mh44wvs.fsf@blackfin.pond.sub.org> <56378572.5020203@redhat.com> <87egg8nro5.fsf@blackfin.pond.sub.org> <5637C2B3.6090609@redhat.com> <87egg7lffd.fsf@blackfin.pond.sub.org> <20151103081917.1d348ad1@redhat.com> <5638B8DE.6020709@redhat.com> <20151103084643.26d71554@redhat.com> <5638BC77.5010102@redhat.com> <20151103092659.126ab97c@redhat.com> From: Paolo Bonzini Message-ID: <5638CA6E.1080003@redhat.com> Date: Tue, 3 Nov 2015 15:53:34 +0100 MIME-Version: 1.0 In-Reply-To: <20151103092659.126ab97c@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] RFC: libyajl for JSON List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Markus Armbruster , "Dr. David Alan Gilbert" , "qemu-devel@nongnu.org" 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