From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awCfZ-0005rf-3O for qemu-devel@nongnu.org; Fri, 29 Apr 2016 13:57:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awCfN-0003An-5A for qemu-devel@nongnu.org; Fri, 29 Apr 2016 13:57:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awCfM-00037r-VT for qemu-devel@nongnu.org; Fri, 29 Apr 2016 13:57:25 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4BA64D2EE1 for ; Fri, 29 Apr 2016 17:57:13 +0000 (UTC) References: <1461903820-3092-1-git-send-email-eblake@redhat.com> <1461903820-3092-4-git-send-email-eblake@redhat.com> <87d1p839ci.fsf@dusky.pond.sub.org> From: Eric Blake Message-ID: <5723A078.2010408@redhat.com> Date: Fri, 29 Apr 2016 11:57:12 -0600 MIME-Version: 1.0 In-Reply-To: <87d1p839ci.fsf@dusky.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="up9MkQvJFMmTQRdGSeetsLpB1LFa4G8om" Subject: Re: [Qemu-devel] [PATCH v3 03/18] qapi: Factor out JSON string escaping List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, famz@redhat.com, Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --up9MkQvJFMmTQRdGSeetsLpB1LFa4G8om Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/29/2016 06:09 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> Pull out a new qstring_append_json_string() helper, so that all >> JSON output producers can use the same output escaping rules. >> >> While it appears that vmstate's use of the simpler qjson.c >> formatter is not currently encountering any string that needs >> escapes to be valid JSON, it is better to be safe than sorry. >> >> Signed-off-by: Eric Blake >> Reviewed-by: Fam Zheng >> - qstring_append(str, "\""); >> + qstring_append_json_string(str, qstring_get_str(val)); >> break; > I think this belongs to qobject-json.c, because it's very much about > JSON (it encapsulates knowledge on JSON string escaping), and a mere > user of QString (it knows nothing about QString's implementation). >=20 > Precedence: qobject_from_json() & friends are there, not in qobject.c. Fair enough. Does the name qstring_append_json_string() still work, or do I need to adjust the name to something with 'qobject' in there, to make it easier to know which header and .c file to use for the function? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --up9MkQvJFMmTQRdGSeetsLpB1LFa4G8om Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXI6B4AAoJEKeha0olJ0Nqy14H/22KWDpuusJrLlWmmRS2c+NB S6tvJYOoqcg4Fr8Y/XU/KkHA0C1YkiVoNLo48fQ5JOlMDp+Jp6rXzNoC8XdlHQo+ p9nYAozY4J6AHdiFsTW1wkhu/zThr281aEecfYOwmhw5Zm3e2No4QxvgDGHW6lUr SIAqQ/zqDn0isx9M4fgR0zBYrfBkwYEjnrLM5dDAIPQypmhI4ncz7INRD0XNhhPS 4kRWMpUAJRsdnL4AUfyWDcVGcMeXRVNp+zo0duvP8Gb9muYY/AfJT/ETa+ybAU3G KifkcK4RabkPFfiYiSRjdpdJ5gyleV3Rn6J3PguLqViPKWfW4phVd3i4+pVR1Aw= =svRQ -----END PGP SIGNATURE----- --up9MkQvJFMmTQRdGSeetsLpB1LFa4G8om--